org.peaseplate
Interface Template

All Known Implementing Classes:
AbstractTemplate, ChunkBasedTemplate

public interface Template

Represents a loaded and compiled template.

Author:
Manfred HANTSCHEL

Method Summary
 TemplateEngine getEngine()
          Returns the template engine that was used to create this template.
 java.util.List<ResourceKey> getImportedResourceKeys()
          Returns the imported resource key
 TemplateLocator getLocator()
          Returns the template locator
 MacroReference getMacroReference(java.lang.String qualifiedName)
          Returns the macro refernce with the specified name and the specified extension
 Messages getMessages(TemplateEngine engine)
          Resolves the messages for this template
 void render(java.io.Writer writer, BuildContext context)
          Renders the template to the specified writer using the specified build context
 void render(java.io.Writer writer, java.lang.Object workingObject)
          Render the template to the specified writer.
 void render(java.io.Writer writer, java.lang.Object workingObject, java.util.Locale locale)
          Render the template to the specified writer.
 void render(java.io.Writer writer, java.lang.Object workingObject, java.util.Locale locale, LineSeparator lineSeparator)
          Renders the template to the specified writer
 

Method Detail

getEngine

TemplateEngine getEngine()
Returns the template engine that was used to create this template.

Returns:
the template engine

getLocator

TemplateLocator getLocator()
Returns the template locator

Returns:
the template locator

getMessages

Messages getMessages(TemplateEngine engine)
                     throws TemplateException
Resolves the messages for this template

Parameters:
engine - the engine
Returns:
the messages for this template
Throws:
TemplateException - on occasion

getImportedResourceKeys

java.util.List<ResourceKey> getImportedResourceKeys()
Returns the imported resource key

Returns:
the imported resource key, may be null

getMacroReference

MacroReference getMacroReference(java.lang.String qualifiedName)
Returns the macro refernce with the specified name and the specified extension

Parameters:
qualifiedName - the qualified name of the macro
Returns:
the macro reference or null if not found

render

void render(java.io.Writer writer,
            java.lang.Object workingObject)
            throws TemplateException,
                   java.io.IOException
Render the template to the specified writer. Uses the default values from the template engine this template was create with.

Parameters:
writer - the writer
workingObject - the working object
Throws:
TemplateException - on occasion
java.io.IOException - on occasion

render

void render(java.io.Writer writer,
            java.lang.Object workingObject,
            java.util.Locale locale)
            throws TemplateException,
                   java.io.IOException
Render the template to the specified writer. Uses the default values from the template engine this template was create with.

Parameters:
writer - the writer
workingObject - the working object
locale - the locale
Throws:
TemplateException - on occasion
java.io.IOException - on occasion

render

void render(java.io.Writer writer,
            java.lang.Object workingObject,
            java.util.Locale locale,
            LineSeparator lineSeparator)
            throws TemplateException,
                   java.io.IOException
Renders the template to the specified writer

Parameters:
writer - the writer
workingObject - the working object
locale - the locale
lineSeparator - the line separator
Throws:
TemplateException - on occasion
java.io.IOException - on occasion

render

void render(java.io.Writer writer,
            BuildContext context)
            throws TemplateException,
                   java.io.IOException
Renders the template to the specified writer using the specified build context

Parameters:
context - the context
writer - the writer
Throws:
TemplateException - on occasion
java.io.IOException - on occasion


Copyright © 2008. All Rights Reserved.