EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.template
Class AbstractTemplateDataSource

java.lang.Object
  extended by echopoint.template.AbstractTemplateDataSource
All Implemented Interfaces:
TemplateDataSource, Serializable
Direct Known Subclasses:
FileTemplateDataSource, JspTemplateDataSource, ResourceTemplateDataSource, StringTemplateDataSource

public abstract class AbstractTemplateDataSource
extends Object
implements TemplateDataSource, Serializable

A base class for TemplateDataSource implementations.

Its uses a SimpleTemplateCachingHints object as its TemplateCachingHints implementation.

See Also:
Serialized Form

Field Summary
static String DEFAULT_CONTENT_TYPE
          the default encoding is text/xhtml
static String DEFAULT_ENCODING
          the default encoding is iso-8859-1
 
Constructor Summary
AbstractTemplateDataSource()
          AbstractTemplateDataSource constructor with default encoding.
AbstractTemplateDataSource(String encoding)
          AbstractTemplateDataSource constructor with encoding.
 
Method Summary
 TemplateCachingHints getCachingHints()
          This returns a hint to the template rendering mechanism as to whether this template data can be cached.
 String getCharacterEncoding()
          This returns the character encoding of the TemplateDataSource.
 TemplateCompilerHints getCompilerHints()
          This returns a hint to the underlying template compiler mechanism as to how the template data should be compiled into XHTML.
 String getContentType()
          This content type of the template data is used by the rendering framework to find an appropriate template compiler.
 void setCachingHints(TemplateCachingHints newValue)
          Sets the caching hints to use for this template data source
 void setCharacterEncoding(String newEncoding)
          Sets the character encoding to be used with this TemplateDataSource
 void setCompilerHints(TemplateCompilerHints compilerHints)
          Sets the TemplateCompilerHints to use for this TemplateDataSource.
 void setContentType(String contentType)
          Sets the content type of the template data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface echopoint.template.TemplateDataSource
getCanonicalName, getInputStream
 

Field Detail

DEFAULT_ENCODING

public static String DEFAULT_ENCODING
the default encoding is iso-8859-1


DEFAULT_CONTENT_TYPE

public static String DEFAULT_CONTENT_TYPE
the default encoding is text/xhtml

Constructor Detail

AbstractTemplateDataSource

public AbstractTemplateDataSource()
AbstractTemplateDataSource constructor with default encoding.


AbstractTemplateDataSource

public AbstractTemplateDataSource(String encoding)
AbstractTemplateDataSource constructor with encoding.

Method Detail

getCharacterEncoding

public String getCharacterEncoding()
Description copied from interface: TemplateDataSource
This returns the character encoding of the TemplateDataSource.

This will be used to create a new InputStreamReader(stream,characterEncoding) from the InputStream return by getInputStream().

Specified by:
getCharacterEncoding in interface TemplateDataSource
Returns:
the character encoding of the TemplateDataSource as defined by the java.io.InputStreamReader() specification.
See Also:
TemplateDataSource.getCharacterEncoding()

setCharacterEncoding

public void setCharacterEncoding(String newEncoding)
Sets the character encoding to be used with this TemplateDataSource

Parameters:
newEncoding - - the new encoding to use
See Also:
TemplateDataSource.getCharacterEncoding()

getCachingHints

public TemplateCachingHints getCachingHints()
Description copied from interface: TemplateDataSource
This returns a hint to the template rendering mechanism as to whether this template data can be cached. If null is returned then the template data will never be cached.

However the inverse is not necessarily the case. You may return a TemplateCachingHints, however this does not mean the rendering mechanism will cache the template data.

You might return null if the template data is especially large and you dont want it retained in cache memory.

Specified by:
getCachingHints in interface TemplateDataSource
Returns:
null if the template data should not be cached or a TemplateCachingHints to say how it might be cached.
See Also:
TemplateDataSource.getCachingHints()

setCachingHints

public void setCachingHints(TemplateCachingHints newValue)
Sets the caching hints to use for this template data source

Parameters:
newValue - - the new hints

getContentType

public String getContentType()
Description copied from interface: TemplateDataSource
This content type of the template data is used by the rendering framework to find an appropriate template compiler.

An example content type is text/xhtml and cause a template compiler to be found for XHTML template data.

Specified by:
getContentType in interface TemplateDataSource
Returns:
the content type of the template data
See Also:
TemplateDataSource.getContentType()

setContentType

public void setContentType(String contentType)
Sets the content type of the template data

Parameters:
contentType - The contentType to set.

getCompilerHints

public TemplateCompilerHints getCompilerHints()
Description copied from interface: TemplateDataSource
This returns a hint to the underlying template compiler mechanism as to how the template data should be compiled into XHTML.

Most of the TemplateCompilerHints properties are really aimed as JAXP XML parser implementations but you can provide generic values via the getAttribute() mechanism.

Specified by:
getCompilerHints in interface TemplateDataSource
Returns:
a TemplateCompilerHints implementation or null if there are no compiler hints
See Also:
TemplateDataSource.getCompilerHints()

setCompilerHints

public void setCompilerHints(TemplateCompilerHints compilerHints)
Sets the TemplateCompilerHints to use for this TemplateDataSource.

Parameters:
compilerHints - - the TemplateCompilerHints to use

EchoPoint API - 3.0.0b5
App Webcontainer