public class DocumentElementPreprocessor extends Object implements DocumentPreprocessor
DocumentElementPreprocessor is a DocumentPreprocessor
that is designed to operate with one or more DocumentElementPreprocessor.ElementPreprocessors.| Modifier and Type | Class and Description |
|---|---|
static interface |
DocumentElementPreprocessor.ElementPreprocessor
An
DocumentElementPreprocessor.ElementPreprocessor provides a mechanism to examine and optionally
mutate an XmlElement prior to it being processed by a
ElementProcessor. |
| Constructor and Description |
|---|
DocumentElementPreprocessor()
Constructs a
DocumentElementPreprocessor. |
| Modifier and Type | Method and Description |
|---|---|
DocumentElementPreprocessor |
addElementPreprocessor(DocumentElementPreprocessor.ElementPreprocessor preprocessor)
|
boolean |
preprocess(ProcessingContext context,
XmlElement xmlElement)
Performs pre-processing of the an
XmlElement, optionally mutating
it (or it's children) as required. |
public DocumentElementPreprocessor()
DocumentElementPreprocessor.public DocumentElementPreprocessor addElementPreprocessor(DocumentElementPreprocessor.ElementPreprocessor preprocessor)
preprocessor - the DocumentElementPreprocessor.ElementPreprocessor to addDocumentElementPreprocessor (this) to support
fluent-style callspublic boolean preprocess(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
XmlElement, optionally mutating
it (or it's children) as required.
Implementations of this interface may traverse and/or perform any
mutations on the specified XmlElement.
Note: It is illegal to modify an XmlElement
outside the scope of the provided XmlElement. eg: Attempting
to modify any of the parents of the provided XmlElement
may result in undefined and unexpected behavior. Only mutations of the
XmlElement itself or children is permitted.
preprocess in interface DocumentPreprocessorcontext - the ProcessingContext in which the
XmlElement is being pre-processedxmlElement - the XmlElement to pre-processtrue if the specified XmlElement should be
reconsidered either by this or other DocumentPreprocessors
for re-preprocessing due to mutations on the XmlElement,
false otherwise.ConfigurationException - if during pre-processing of the
XmlElement a configuration issue was
discovered (or if pre-processing fails for some reason)