Class AbstractEmptyElementProcessor<T>
- java.lang.Object
-
- com.tangosol.coherence.config.xml.processor.AbstractEmptyElementProcessor<T>
-
- All Implemented Interfaces:
ConditionalElementProcessor<T>
,ElementProcessor<T>
- Direct Known Subclasses:
EnumProcessor
,MemberListenerProcessor
,MemorySizeProcessor
,MillisProcessor
,PartitionListenerProcessor
,PasswordProviderBuilderProcessor
,PersistenceEnvironmentsProcessor.PersistenceEnvironmentProcessor
,PersistenceProcessor
,ResourceBuilderProcessor
,SerializerBuilderProcessor
,SerializerFactoryProcessor
,ServiceFailurePolicyProcessor
,SimpleBuilderProcessor
,SpecificInstanceProcessor
,StorageAccessAuthorizerBuilderProcessor
public abstract class AbstractEmptyElementProcessor<T> extends Object implements ConditionalElementProcessor<T>
AConditionalElementProcessor
that provides defined behaviors for processing emptyXmlElement
s.- Since:
- Coherence 12.1.3
- Author:
- bo 2013.09.15
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractEmptyElementProcessor.EmptyElementBehavior
The behavior of theConditionalElementProcessor
when it encounters an emptyXmlElement
.
-
Constructor Summary
Constructors Constructor Description AbstractEmptyElementProcessor()
Constructs anAbstractEmptyElementProcessor
that will attempt to process emptyXmlElement
s.AbstractEmptyElementProcessor(AbstractEmptyElementProcessor.EmptyElementBehavior behavior)
Constructs anAbstractEmptyElementProcessor
with the specified behavior for processing emptyXmlElement
s (with a default value ofnull
).AbstractEmptyElementProcessor(T oDefaultValue)
Constructs anAbstractEmptyElementProcessor
that will return the specified default value when it encounters an emptyXmlElement
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
accepts(ProcessingContext context, XmlElement xmlElement)
Determines if the specifiedXmlElement
should be processed.protected boolean
isEmptyElement(ProcessingContext context, XmlElement xmlElement)
Determines if anXmlElement
is considered empty.protected abstract T
onProcess(ProcessingContext context, XmlElement xmlElement)
Process anXmlElement
to return a specific type of value.T
process(ProcessingContext context, XmlElement xmlElement)
Process anXmlElement
to return a specific type of value.
-
-
-
Constructor Detail
-
AbstractEmptyElementProcessor
public AbstractEmptyElementProcessor()
Constructs anAbstractEmptyElementProcessor
that will attempt to process emptyXmlElement
s.
-
AbstractEmptyElementProcessor
public AbstractEmptyElementProcessor(AbstractEmptyElementProcessor.EmptyElementBehavior behavior)
Constructs anAbstractEmptyElementProcessor
with the specified behavior for processing emptyXmlElement
s (with a default value ofnull
).- Parameters:
behavior
- the requiredAbstractEmptyElementProcessor.EmptyElementBehavior
-
AbstractEmptyElementProcessor
public AbstractEmptyElementProcessor(T oDefaultValue)
Constructs anAbstractEmptyElementProcessor
that will return the specified default value when it encounters an emptyXmlElement
.- Parameters:
oDefaultValue
- the default value to return
-
-
Method Detail
-
onProcess
protected abstract T onProcess(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
Process anXmlElement
to return a specific type of value.- Parameters:
context
- theProcessingContext
in which theXmlElement
is being processedxmlElement
- theXmlElement
to process- Returns:
- a value of type T
- Throws:
ConfigurationException
- when a configuration problem was encountered
-
isEmptyElement
protected boolean isEmptyElement(ProcessingContext context, XmlElement xmlElement)
Determines if anXmlElement
is considered empty.- Parameters:
context
- theProcessingContext
in which theXmlElement
is being processedxmlElement
- theXmlElement
to process- Returns:
true
if theXmlElement
is considered empty
-
accepts
public boolean accepts(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
Determines if the specifiedXmlElement
should be processed.- Specified by:
accepts
in interfaceConditionalElementProcessor<T>
- Parameters:
context
- theProcessingContext
in which theXmlElement
is being processedxmlElement
- theXmlElement
that would be processed- Returns:
true
if theXmlElement
should be processed- Throws:
ConfigurationException
- when a configuration problem was encountered
-
process
public final T process(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
Process anXmlElement
to return a specific type of value.- Specified by:
process
in interfaceElementProcessor<T>
- Parameters:
context
- theProcessingContext
in which theXmlElement
is being processedxmlElement
- theXmlElement
to process- Returns:
- a value of type T
- Throws:
ConfigurationException
- when a configuration problem was encountered
-
-