public abstract class AbstractEmptyElementProcessor<T> extends Object implements ConditionalElementProcessor<T>
ConditionalElementProcessor that provides defined behaviors
for processing empty XmlElements.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractEmptyElementProcessor.EmptyElementBehavior
The behavior of the
ConditionalElementProcessor when it encounters
an empty XmlElement. |
| Constructor and Description |
|---|
AbstractEmptyElementProcessor()
Constructs an
AbstractEmptyElementProcessor that will
attempt to process empty XmlElements. |
AbstractEmptyElementProcessor(AbstractEmptyElementProcessor.EmptyElementBehavior behavior)
Constructs an
AbstractEmptyElementProcessor with the
specified behavior for processing empty XmlElements
(with a default value of null). |
AbstractEmptyElementProcessor(T oDefaultValue)
Constructs an
AbstractEmptyElementProcessor that will
return the specified default value when it encounters an empty
XmlElement. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(ProcessingContext context,
XmlElement xmlElement)
Determines if the specified
XmlElement should be processed. |
protected boolean |
isEmptyElement(ProcessingContext context,
XmlElement xmlElement)
Determines if an
XmlElement is considered empty. |
protected abstract T |
onProcess(ProcessingContext context,
XmlElement xmlElement)
Process an
XmlElement to return a specific type of value. |
T |
process(ProcessingContext context,
XmlElement xmlElement)
Process an
XmlElement to return a specific type of value. |
public AbstractEmptyElementProcessor()
AbstractEmptyElementProcessor that will
attempt to process empty XmlElements.public AbstractEmptyElementProcessor(AbstractEmptyElementProcessor.EmptyElementBehavior behavior)
AbstractEmptyElementProcessor with the
specified behavior for processing empty XmlElements
(with a default value of null).behavior - the required AbstractEmptyElementProcessor.EmptyElementBehaviorpublic AbstractEmptyElementProcessor(T oDefaultValue)
AbstractEmptyElementProcessor that will
return the specified default value when it encounters an empty
XmlElement.oDefaultValue - the default value to returnprotected abstract T onProcess(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
XmlElement to return a specific type of value.context - the ProcessingContext in which the
XmlElement is being processedxmlElement - the XmlElement to processConfigurationException - when a configuration problem was encounteredprotected boolean isEmptyElement(ProcessingContext context, XmlElement xmlElement)
XmlElement is considered empty.context - the ProcessingContext in which the
XmlElement is being processedxmlElement - the XmlElement to processtrue if the XmlElement is considered emptypublic boolean accepts(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
XmlElement should be processed.accepts in interface ConditionalElementProcessor<T>context - the ProcessingContext in which the XmlElement is being processedxmlElement - the XmlElement that would be processedtrue if the XmlElement should be processedConfigurationException - when a configuration problem was encounteredpublic final T process(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
XmlElement to return a specific type of value.process in interface ElementProcessor<T>context - the ProcessingContext in which the
XmlElement is being processedxmlElement - the XmlElement to processConfigurationException - when a configuration problem was encountered