public abstract class TemplateOutletImpl extends OutletImpl implements TemplateOutlet
Modifier | Constructor and Description |
---|---|
protected |
TemplateOutletImpl(QualifiedName name,
ConfigurationProvider configurationProvider,
String path,
String encoding,
TemplateFilter templateFilter)
Constructs a TemplateOutletImpl with the given name.
|
Modifier and Type | Method and Description |
---|---|
String |
getContent(ControllerState controllerState)
Returns the contents as a Template as a String.
|
protected String |
getDetokenizedPath(ControllerState controllerState) |
String |
getPath()
Returns the path to the template.
|
protected String |
load(InputStream inputStream,
String encoding,
TemplateFilter filter)
Loads the template, possibly filtering the content..
|
String |
toString()
Returns a String representation of this outlet for debugging purposes.
|
addMergepointMapping, afterExecute, beforeExecute, execute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, getVariable, mergepoint, setInputClass, setInputElementName, setMergepointMapping, setVariable, setVariable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addMergepointMapping, afterExecute, beforeExecute, execute, getInputClass, getInputElementName, getMergepointMapping, getMergepointMappings, getName, setInputClass, setInputElementName, setMergepointMapping
protected TemplateOutletImpl(QualifiedName name, ConfigurationProvider configurationProvider, String path, String encoding, TemplateFilter templateFilter) throws ConfigurationException
name
- the name of this outlet, not null.configurationProvider
- the provider for reading the templates,
not null.path
- the path to the templates, not null.
May contain tokens of the form ${....}, these are parsed.encoding
- the encoding of the file, or null if the system's
default encoding should be used.templateFilter
- a possible filter for preprocessing the template,
not null.NullPointerException
- if name or inputStream are null.ConfigurationException
- if the template cannot be loaded.public String getContent(ControllerState controllerState) throws ConfigurationException
TemplateOutlet
getContent
in interface TemplateOutlet
controllerState
- the state of the controller, not null.ConfigurationException
- if the template cannot be read.protected String getDetokenizedPath(ControllerState controllerState)
protected String load(InputStream inputStream, String encoding, TemplateFilter filter) throws IOException
inputStream
- the stream to read from.encoding
- the encoding of the template, or null for auto detection.filter
- a filter for modifying the template,
or null for no filtering.IOException
- if an error occurs while reading the template.public String getPath()
public String toString()
toString
in class OutletImpl
Object.toString()
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.