|
|||||||||||
| 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 unsupported
public 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 unsupported| Method Detail |
protected java.io.Reader getReader()
throws java.io.IOException
getReader in class WMTemplatejava.io.IOException - if unable to read templatepublic java.lang.String toString()
toString in class WMTemplatepublic java.lang.String getName()
WMTemplate
getName in interface TemplategetName in class WMTemplatepublic void setName(java.lang.String name)
WMTemplate
setName in interface TemplatesetName in class WMTemplatepublic static void main(java.lang.String[] arg)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||