xv.text.template
Class StringTemplateElement

java.lang.Object
  extended by xv.text.template.TemplateElement
      extended by xv.text.template.StringTemplateElement

public final class StringTemplateElement
extends TemplateElement

Very simple template element that always appends a static string.

Author:
dmpotter

Field Summary
 
Fields inherited from class xv.text.template.TemplateElement
nextElement
 
Constructor Summary
StringTemplateElement(String content)
           
 
Method Summary
 TemplateElement execute(TemplateEnvironment environment, Appendable out)
          Execute the current token.
 
Methods inherited from class xv.text.template.TemplateElement
addChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTemplateElement

public StringTemplateElement(String content)
Method Detail

execute

public TemplateElement execute(TemplateEnvironment environment,
                               Appendable out)
                        throws TemplateException,
                               IOException
Description copied from class: TemplateElement
Execute the current token.

Specified by:
execute in class TemplateElement
Parameters:
environment - the environment to use
out - the appendable to write the generated text to
Returns:
the next template element to execute, or null to end the template execution - generally subclasses should just return TemplateElement.nextElement unless they implement some sort of flow control
Throws:
TemplateException - if an error occurs within the templating system
IOException - if an I/O error occurs - this should never be thrown by an implementation directly, solely by the Appendable being written to


Copyright © 2008-2011. All Rights Reserved.