|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.melati.template.ClassNameTempletLoader
public final class ClassNameTempletLoader
Load a template to render an object based upon the object's class.
Method Summary | |
---|---|
protected static String |
classpathTempletPath(Class<?> clazz,
TemplateEngine templateEngine)
|
static ClassNameTempletLoader |
getInstance()
|
Template |
templet(TemplateEngine templateEngine,
MarkupLanguage markupLanguage,
Class<?> clazz)
Get a templet for a class. |
Template |
templet(TemplateEngine templateEngine,
MarkupLanguage markupLanguage,
FieldAttributes attributes)
Get a templet either from the classname concatenated with FieldAttributes.RenederInfo or the class name. |
Template |
templet(TemplateEngine templateEngine,
MarkupLanguage markupLanguage,
String name)
Get a templet by its name, looking only in the templets directory. |
Template |
templet(TemplateEngine templateEngine,
MarkupLanguage markupLanguage,
String purpose,
Class<?> clazz)
Get a templet based upon class name and optional purpose, looking in the templets directory and also the classpath. |
Template |
templet(TemplateEngine templateEngine,
MarkupLanguage markupLanguage,
String purpose,
String name)
Get a templet by name, with optional purpose. |
protected static String |
templetsPath(TemplateEngine templateEngine,
MarkupLanguage markupLanguage)
|
protected static String |
templetsTempletPath(TemplateEngine templateEngine,
MarkupLanguage markupLanguage,
String purpose,
String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ClassNameTempletLoader getInstance()
protected static String templetsPath(TemplateEngine templateEngine, MarkupLanguage markupLanguage)
protected static String templetsTempletPath(TemplateEngine templateEngine, MarkupLanguage markupLanguage, String purpose, String name)
protected static String classpathTempletPath(Class<?> clazz, TemplateEngine templateEngine)
public Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, String purpose, String name) throws NotFoundException
templet
in interface TempletLoader
templateEngine
- the TemplateEngine in usemarkupLanguage
- the markuplanguage the templet is inpurpose
- what the templet is for eg errorname
- the name of the templet
NotFoundException
- if template not foundTempletLoader#templet(TemplateEngine, AbstractMarkupLanguage, String, String)
public Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, String name) throws NotFoundException
templet
in interface TempletLoader
templateEngine
- the TemplateEngine in usemarkupLanguage
- the markuplanguage the templet is inname
- the name of the templet
NotFoundException
- if template not foundTempletLoader.templet(TemplateEngine, MarkupLanguage, String)
public Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, String purpose, Class<?> clazz) throws TemplateEngineException
templet
in interface TempletLoader
templateEngine
- the TemplateEngine in usemarkupLanguage
- the markuplanguage the templet is inpurpose
- what the templet is for eg errorclazz
- Class that templet renders
TemplateEngineException
TempletLoader.templet(TemplateEngine, MarkupLanguage,
String, Class)
public Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, Class<?> clazz)
org/melati/template/TEMPLATE_ENGINE_NAME/MARKUP_LANGUAGE/java.lang.Object.wm
which is the lowest possible template and is always found.
The template is also looked for in the resource directory for that class.
The search results are cached, so that searches are not repeated.
templet
in interface TempletLoader
templateEngine
- the TemplateEngine in usemarkupLanguage
- the markuplanguage the templet is inclazz
- the class name to translate into a template name
TempletLoader.templet(TemplateEngine, MarkupLanguage, Class)
public Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, FieldAttributes attributes)
templet
in interface TempletLoader
templateEngine
- the TemplateEngine in usemarkupLanguage
- the markuplanguage the templet is inattributes
- a FieldAttributes the templet is for eg a Field
TempletLoader.templet(TemplateEngine,MarkupLanguage,FieldAttributes)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |