public class SpecificInstanceProcessor<T> extends AbstractEmptyElementProcessor<T>
ElementProcessor
that will process an XmlElement
defining
a ParameterizedBuilder
, after which it will eagerly realized to produce
an instance of the required type.AbstractEmptyElementProcessor.EmptyElementBehavior
Constructor and Description |
---|
SpecificInstanceProcessor(Class<T> clzToRealize)
Constructs a
SpecificInstanceProcessor for the specified Class . |
SpecificInstanceProcessor(Class<T> clzToRealize,
AbstractEmptyElementProcessor.EmptyElementBehavior behavior)
Constructs a
SpecificInstanceProcessor for the specified Class . |
SpecificInstanceProcessor(Class<T> clzToRealize,
T oDefaultValue)
Constructs a
SpecificInstanceProcessor for the specified Class . |
Modifier and Type | Method and Description |
---|---|
T |
onProcess(ProcessingContext context,
XmlElement xmlElement)
Process an
XmlElement to return a specific type of value. |
accepts, isEmptyElement, process
public SpecificInstanceProcessor(Class<T> clzToRealize)
SpecificInstanceProcessor
for the specified Class
.clzToRealize
- the class that will be instantiated, injected and
returned during processingpublic SpecificInstanceProcessor(Class<T> clzToRealize, AbstractEmptyElementProcessor.EmptyElementBehavior behavior)
SpecificInstanceProcessor
for the specified Class
.clzToRealize
- the class that will be instantiated, injected and
returned during processingbehavior
- the AbstractEmptyElementProcessor.EmptyElementBehavior
when an empty
XmlElement
is encounteredpublic SpecificInstanceProcessor(Class<T> clzToRealize, T oDefaultValue)
SpecificInstanceProcessor
for the specified Class
.clzToRealize
- the class that will be instantiated, injected and
returned during processingoDefaultValue
- the value to return when an empty XmlElement
is encounteredpublic T onProcess(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
XmlElement
to return a specific type of value.onProcess
in class AbstractEmptyElementProcessor<T>
context
- the ProcessingContext
in which the
XmlElement
is being processedxmlElement
- the XmlElement
to processConfigurationException
- when a configuration problem was encountered