org.melati.template
Interface TempletLoader

Package class diagram package TempletLoader
All Known Implementing Classes:
ClassNameTempletLoader

public interface TempletLoader

An object which can load a templet given a TemplateEngine, a MarkupLanguage and a means of identifying the templet.


Method Summary
 Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, Class<?> clazz)
          Return a templet for a given class, looking for a template with the same name as the class in the Melati templet directory; giving a full template path as: org/melati/template/TEMPLATE_ENGINE_NAME/MARKUP_LANGUAGE/java.lang.Object.wm which is the lowest possible template and is always found.
 Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, FieldAttributes attributes)
          Return a templet to render a Field.
 Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, String templetName)
          Return a templet by name.
 Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, String purpose, Class<?> clazz)
          Return a templet by Class and Purpose.
 Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, String purpose, String templetName)
          Return a templet by name and purpose.
 

Method Detail

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 String templetName)
                 throws NotFoundException
Return a templet by name.

Parameters:
templateEngine - the TemplateEngine in use
markupLanguage - the markuplanguage the templet is in
templetName - the name of the templet
Returns:
the templet
Throws:
NotFoundException - if template not found

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 String purpose,
                 String templetName)
                 throws NotFoundException
Return a templet by name and purpose.

Parameters:
templateEngine - the TemplateEngine in use
markupLanguage - the markuplanguage the templet is in
purpose - what the templet is for eg error
templetName - the name of the templet
Returns:
the templet
Throws:
NotFoundException - if template not found

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 Class<?> clazz)
Return a templet for a given class, looking for a template with the same name as the class in the Melati templet directory; giving a full template path as: 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.

Parameters:
templateEngine - the TemplateEngine in use
markupLanguage - the markuplanguage the templet is in
clazz - the class name to translate into a template name
Returns:
the templet

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 String purpose,
                 Class<?> clazz)
Return a templet by Class and Purpose. The purpose search path is the normal search path with the purpose appended, separated by a "/". If there is no template found then the normal search path is searched. The purpose is then re-appended to the supperclasses searchpath and so on up the tree, stopping at Object, which is always found.

Parameters:
templateEngine - the TemplateEngine in use
markupLanguage - the markuplanguage the templet is in
purpose - what the templet is for eg error
clazz - Class that templet renders
Returns:
the templet

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 FieldAttributes attributes)
Return a templet to render a Field.

Parameters:
templateEngine - the TemplateEngine in use
markupLanguage - the markuplanguage the templet is in
attributes - a FieldAttributes the templet is for eg a Field
Returns:
the templet


Copyright © 2000-2010 PanEris. All Rights Reserved.