Package fmpp
Class XmlRenderingConfiguration
java.lang.Object
fmpp.XmlRenderingConfiguration
Stores options that describe when and how to process an XML file in
"renderXml" processing mode.
Do not change this object after you have added it to the
Engine
. It's in principle
an immutable object, but to prevent too many constructor parameters and
later backward compatibility problems, you have to specify the options with
setter methods, rather than with constructor arguments.
You must set a non-null
template
or set
copy
to true
. All other options are optional.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocumentElement
(String xmlns, String localName) Adds an element to the list of document elements.void
addLocalDataBuilder
(LocalDataBuilder localDataBuilder) Adds an extra local data builder that is invoked after all other local data builders.void
addSourcePathPattern
(String pathPattern) Adds a path to the list of source path patterns.void
addXmlDataLoaderOption
(String name, Object value) Adds or replaces an option in the map of xml data loader options.void
Empties the document element list.void
Removes all local data builders.void
Empties the list of source path patterns.void
Removes all xml data loader options.void
setCopy
(boolean copy) Sets if the XML file should be copied as is, or renderd with a template.void
setTemplate
(String template) Sets the renderer template.toString()
-
Constructor Details
-
XmlRenderingConfiguration
public XmlRenderingConfiguration()Creates new object.
-
-
Method Details
-
setTemplate
Sets the renderer template.- Parameters:
template
- the source path of the template used for the rendering of the XML file. Can't benull
.
-
setCopy
public void setCopy(boolean copy) Sets if the XML file should be copied as is, or renderd with a template. If the value of this option istrue
, then the value of thetemplate
option is insignificant. -
addDocumentElement
Adds an element to the list of document elements. The XML file will not be processed according this configuration object if this list doesn't contain the document element of the XML file. If the list is empty, then this criteria will not be considered (accepts XML documents regardels of their document element).- Parameters:
xmlns
- the name-space URL of the element. This should benull
or 0-length stirng if the element doesn't belong to any XML name-space.localName
- the local (name-space preixless) name of the element.
-
clearDocumentElements
public void clearDocumentElements()Empties the document element list.- See Also:
-
addLocalDataBuilder
Adds an extra local data builder that is invoked after all other local data builders. The task of this builder is to do the complex or resource eager parts of the XML processing that you don't want to do in FTL, and expose the results as local data.The data loaders added earlier will be executed earlier. The data loader executed later can replace earlier added local data variables.
-
clearLocalDataBuilders
public void clearLocalDataBuilders()Removes all local data builders.- See Also:
-
addSourcePathPattern
Adds a path to the list of source path patterns. The XML file will not be processed according this configuration object if no path in this list matches the source root relative path of the XML file. If the list is empty, then this criteria will not be considered (accepts XML documents regardels of their source file path).- Parameters:
pathPattern
- the path pattern of the source root relative path of the XML file. It doesn't mater if it starts with / or not.
-
clearSourcePathPatterns
public void clearSourcePathPatterns()Empties the list of source path patterns.- See Also:
-
addXmlDataLoaderOption
Adds or replaces an option in the map of xml data loader options. The set of valid values are specified by the xml data loader (see in the FMPP Manual), and they will not be validated until the data loader is actually invoked, so when the processing of the XML file starts. The only exception from this rule is the"namespaceAware"
option, for whichfalse
value is not allowed.- Parameters:
name
- the name of the option. Option"namespaceAware"
is not allowed.value
- the value of the option
-
clearXmlDataLoaderOptions
public void clearXmlDataLoaderOptions()Removes all xml data loader options. -
toString
-