org.peaseplate.internal.template
Class ChunkBasedTemplate

java.lang.Object
  extended by org.peaseplate.internal.template.AbstractTemplate
      extended by org.peaseplate.internal.template.ChunkBasedTemplate
All Implemented Interfaces:
Template

public class ChunkBasedTemplate
extends AbstractTemplate


Constructor Summary
ChunkBasedTemplate(TemplateEngine engine, TemplateLocator locator, Chunk[] chunks, java.util.List<ResourceKey> importedResourceKeys, java.util.Map<java.lang.String,MacroBlock> macroBlocks)
           
 
Method Summary
 java.util.List<ResourceKey> getImportedResourceKeys()
          Returns the imported resource key
 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
 java.lang.String toString()
           
 
Methods inherited from class org.peaseplate.internal.template.AbstractTemplate
getEngine, getLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChunkBasedTemplate

public ChunkBasedTemplate(TemplateEngine engine,
                          TemplateLocator locator,
                          Chunk[] chunks,
                          java.util.List<ResourceKey> importedResourceKeys,
                          java.util.Map<java.lang.String,MacroBlock> macroBlocks)
Method Detail

getMessages

public Messages getMessages(TemplateEngine engine)
                     throws TemplateException
Description copied from interface: Template
Resolves the messages for this template

Parameters:
engine - the engine
Returns:
the messages for this template
Throws:
TemplateException - on occasion
See Also:
Template.getMessages(org.peaseplate.TemplateEngine)

getImportedResourceKeys

public java.util.List<ResourceKey> getImportedResourceKeys()
Description copied from interface: Template
Returns the imported resource key

Returns:
the imported resource key, may be null
See Also:
Template.getImportedResourceKeys()

getMacroReference

public MacroReference getMacroReference(java.lang.String qualifiedName)
Description copied from interface: Template
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
See Also:
Template.getMacroReference(java.lang.String)

render

public void render(java.io.Writer writer,
                   java.lang.Object workingObject)
            throws TemplateException,
                   java.io.IOException
Description copied from interface: Template
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
See Also:
Template.render(java.io.Writer, java.lang.Object)

render

public void render(java.io.Writer writer,
                   java.lang.Object workingObject,
                   java.util.Locale locale)
            throws TemplateException,
                   java.io.IOException
Description copied from interface: Template
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
See Also:
Template.render(java.io.Writer, java.lang.Object, java.util.Locale)

render

public void render(java.io.Writer writer,
                   java.lang.Object workingObject,
                   java.util.Locale locale,
                   LineSeparator lineSeparator)
            throws TemplateException,
                   java.io.IOException
Description copied from interface: Template
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
See Also:
org.peaseplate.Template#render(java.io.Writer, java.lang.Object, java.util.Locale, java.lang.String)

render

public void render(java.io.Writer writer,
                   BuildContext context)
            throws TemplateException,
                   java.io.IOException
Description copied from interface: Template
Renders the template to the specified writer using the specified build context

Parameters:
writer - the writer
context - the context
Throws:
TemplateException - on occasion
java.io.IOException - on occasion
See Also:
Template.render(java.io.Writer, org.peaseplate.internal.BuildContext)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2008. All Rights Reserved.