org.melati.template
Interface 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, java.lang.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, java.lang.String templetName)
          Return a templet by name.
 Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, java.lang.String purpose, java.lang.Class clazz)
          Return a templet by Class and Purpose.
 Template templet(TemplateEngine templateEngine, MarkupLanguage markupLanguage, java.lang.String purpose, java.lang.String templetName)
          Return a templet by name and purpose.
 

Method Detail

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 java.lang.String templetName)
                 throws java.io.IOException,
                        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:
java.io.IOException - if TemplateEngine does
NotFoundException - if template not found

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 java.lang.String purpose,
                 java.lang.String templetName)
                 throws java.io.IOException,
                        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:
java.io.IOException - if TemplateEngine does
NotFoundException - if template not found

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 java.lang.Class clazz)
                 throws java.io.IOException
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
Throws:
java.io.IOException - if TemplateEngine does

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 java.lang.String purpose,
                 java.lang.Class clazz)
                 throws java.io.IOException
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
Throws:
java.io.IOException - if TemplateEngine does

templet

Template templet(TemplateEngine templateEngine,
                 MarkupLanguage markupLanguage,
                 FieldAttributes attributes)
                 throws java.io.IOException
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
Throws:
java.io.IOException - if TemplateEngine does


Copyright © 2000-2008 PanEris. All Rights Reserved.