| java.lang.Object org.apache.turbine.services.template.mapper.BaseMapper org.apache.turbine.services.template.mapper.ClassMapper
ClassMapper | public class ClassMapper extends BaseMapper implements Mapper(Code) | | This mapper tries to map Template names to class names. If no direct match
is found, it tries matches "upwards" in the package hierarchy until either
a match is found or the root is hit. Then it returns the name of the
default class from the TemplateEngineService.
1. about.directions.Driving <- direct matching the template to the class name
2. about.directions.Default <- matching the package, class name is Default
3. about.Default <- stepping up in the package hierarchy, looking for Default
4. Default <- Class called "Default" without package
5. VelocityScreen <- The class configured by the Service (VelocityService) to
Please note, that no actual packages are searched. This is the scope of the
TemplateEngine Loader which is passed at construction time.
author: Henning P. Schmiedehausen version: $Id: ClassMapper.java 534527 2007-05-02 16:10:59Z tv $ |
Constructor Summary | |
public | ClassMapper() Default C'tor. |
Method Summary | |
public String | doMapping(String template) Strip off a possible extension, replace all "," with "."
Look through the given package path until a match is found.
Parameters: template - The template name. | public Loader | getLoader() Get the Loader value. | public void | setLoader(Loader loader) Set the Loader value. |
ClassMapper | public ClassMapper()(Code) | | Default C'tor. If you use this C'tor, you must use
the bean setter to set the various properties needed for
this mapper before first usage.
|
doMapping | public String doMapping(String template)(Code) | | Strip off a possible extension, replace all "," with "."
Look through the given package path until a match is found.
Parameters: template - The template name. A class name for the given template. |
getLoader | public Loader getLoader()(Code) | | Get the Loader value.
the Loader value. |
setLoader | public void setLoader(Loader loader)(Code) | | Set the Loader value.
Parameters: loader - The new Loader value. |
|
|