|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.engine.WMTemplate
org.webmacro.engine.StreamTemplate
StreamTempaltes are constructed with a stream from which they read their data. They can only read the stream once, and after that will throw an exception. Mostly they are useful for testing WebMacro directives on the command line, since a main() is provided which reads the template on standard input.
Field Summary |
Fields inherited from class org.webmacro.engine.WMTemplate |
_broker, _content, _log |
Constructor Summary | |
StreamTemplate(Broker broker,
java.io.InputStream in)
Instantiate a template based on the specified stream Will use webmacro's default encoding. |
|
StreamTemplate(Broker broker,
java.io.InputStream in,
java.lang.String encoding)
Instantiate a template based on the specified stream If encoding is null, webmacro's default encoding will be used. |
|
StreamTemplate(Broker broker,
java.io.Reader inStream)
Instantiate a template based on the specified stream |
Method Summary | |
java.lang.String |
getName()
Return a name for this template. |
protected java.io.Reader |
getReader()
Get the stream the template should be read from. |
static void |
main(java.lang.String[] arg)
Simple test |
void |
setName(java.lang.String name)
Set the name for this template. |
java.lang.String |
toString()
Return a name for this template. |
Methods inherited from class org.webmacro.engine.WMTemplate |
accept, evaluate, getDefaultEncoding, getMacros, getParam, getParameters, getParser, parse, setParam, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StreamTemplate(Broker broker, java.io.Reader inStream)
public StreamTemplate(Broker broker, java.io.InputStream in) throws java.io.IOException
broker
- broker for this templatein
- input stream to read template from
java.io.IOException
- if default encoding is unsupportedpublic StreamTemplate(Broker broker, java.io.InputStream in, java.lang.String encoding) throws java.io.IOException
broker
- broker for this templatein
- input stream to read template fromencoding
- encoding of input stream
java.io.IOException
- if encoding is unsupportedMethod Detail |
protected java.io.Reader getReader() throws java.io.IOException
getReader
in class WMTemplate
java.io.IOException
- if unable to read templatepublic java.lang.String toString()
toString
in class WMTemplate
public java.lang.String getName()
WMTemplate
getName
in interface Template
getName
in class WMTemplate
public void setName(java.lang.String name)
WMTemplate
setName
in interface Template
setName
in class WMTemplate
public static void main(java.lang.String[] arg)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |