EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.template
Class StringTemplateDataSource

java.lang.Object
  extended by echopoint.template.AbstractTemplateDataSource
      extended by echopoint.template.StringTemplateDataSource
All Implemented Interfaces:
TemplateDataSource, Serializable

public class StringTemplateDataSource
extends AbstractTemplateDataSource

StringTemplateDataSource takes it template data from a String object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class echopoint.template.AbstractTemplateDataSource
DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING
 
Constructor Summary
StringTemplateDataSource()
          Constructs a StringTemplateDataSource with no String template data.
StringTemplateDataSource(String s)
          Creates a StringTemplateDataSource with Unicode character encoding.
 
Method Summary
 String getCanonicalName()
          Returns a canonical name of this TemplateDataSource.
 InputStream getInputStream()
          Gets an InputStream of this TemplateDataSource.
 String getString()
           
 void setString(String string)
           
 
Methods inherited from class echopoint.template.AbstractTemplateDataSource
getCachingHints, getCharacterEncoding, getCompilerHints, getContentType, setCachingHints, setCharacterEncoding, setCompilerHints, setContentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTemplateDataSource

public StringTemplateDataSource(String s)
Creates a StringTemplateDataSource with Unicode character encoding.


StringTemplateDataSource

public StringTemplateDataSource()
Constructs a StringTemplateDataSource with no String template data.

Method Detail

getCanonicalName

public String getCanonicalName()
Description copied from interface: TemplateDataSource
Returns a canonical name of this TemplateDataSource.

The name returned here is used to look up the parsing result of the internal caching, so it should differ for all different TemplateDataSource objects :-)

May return null if this TemplateDataSource is supposed to be parsed each time. The canonical name would be something like a filename or an URL.

Returns:
a unique name of the TemplateDataSource
See Also:
TemplateDataSource.getCanonicalName()

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: TemplateDataSource
Gets an InputStream of this TemplateDataSource.

Note that this method may be called multiple times in the life of the TemplateDataSource. So you probably have to implement a buffer if your underlying data source is transient ..

Returns:
a InputStream containing the template data
Throws:
IOException
See Also:
TemplateDataSource.getInputStream()

getString

public String getString()
Returns:
Returns the string.

setString

public void setString(String string)
Parameters:
string - The string to set.

EchoPoint API - 3.0.0b5
App Webcontainer