com.moesol.generator.core
Class Template

java.lang.Object
  extended by com.moesol.generator.core.Template

public class Template
extends Object

Process a template file and replace occurrences of ${foo} with the value of the property foo.


Constructor Summary
Template(InputStream is)
           
Template(Reader r)
           
Template(String t)
           
 
Method Summary
 void apply(Properties p, Writer out)
           
 String getErrorPrefix()
           
 Reader getInput()
           
 Object getObject()
           
 void setErrorPrefix(String info)
          Message to prepend to thrown error messages.
 void setInput(Reader r)
           
 void setObject(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Template

public Template(InputStream is)

Template

public Template(Reader r)

Template

public Template(String t)
Method Detail

setInput

public void setInput(Reader r)

getInput

public Reader getInput()
Returns:
the input reader used for the source of the template. Note that input reader set by the constructor and setInput is wrapped by a LineNumberReader, which this method returns.

setObject

public void setObject(Object o)

getObject

public Object getObject()

setErrorPrefix

public void setErrorPrefix(String info)
Message to prepend to thrown error messages.


getErrorPrefix

public String getErrorPrefix()

apply

public void apply(Properties p,
                  Writer out)
           throws ApplyException
Throws:
ApplyException


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.