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>
AConditionalElementProcessorthat provides defined behaviors for processing emptyXmlElements.- Since:
- Coherence 12.1.3
- Author:
- bo 2013.09.15
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractEmptyElementProcessor.EmptyElementBehaviorThe behavior of theConditionalElementProcessorwhen it encounters an emptyXmlElement.
-
Constructor Summary
Constructors Constructor Description AbstractEmptyElementProcessor()Constructs anAbstractEmptyElementProcessorthat will attempt to process emptyXmlElements.AbstractEmptyElementProcessor(AbstractEmptyElementProcessor.EmptyElementBehavior behavior)Constructs anAbstractEmptyElementProcessorwith the specified behavior for processing emptyXmlElements (with a default value ofnull).AbstractEmptyElementProcessor(T oDefaultValue)Constructs anAbstractEmptyElementProcessorthat 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 booleanaccepts(ProcessingContext context, XmlElement xmlElement)Determines if the specifiedXmlElementshould be processed.protected booleanisEmptyElement(ProcessingContext context, XmlElement xmlElement)Determines if anXmlElementis considered empty.protected abstract TonProcess(ProcessingContext context, XmlElement xmlElement)Process anXmlElementto return a specific type of value.Tprocess(ProcessingContext context, XmlElement xmlElement)Process anXmlElementto return a specific type of value.
-
-
-
Constructor Detail
-
AbstractEmptyElementProcessor
public AbstractEmptyElementProcessor()
Constructs anAbstractEmptyElementProcessorthat will attempt to process emptyXmlElements.
-
AbstractEmptyElementProcessor
public AbstractEmptyElementProcessor(AbstractEmptyElementProcessor.EmptyElementBehavior behavior)
Constructs anAbstractEmptyElementProcessorwith the specified behavior for processing emptyXmlElements (with a default value ofnull).- Parameters:
behavior- the requiredAbstractEmptyElementProcessor.EmptyElementBehavior
-
AbstractEmptyElementProcessor
public AbstractEmptyElementProcessor(T oDefaultValue)
Constructs anAbstractEmptyElementProcessorthat 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 anXmlElementto return a specific type of value.- Parameters:
context- theProcessingContextin which theXmlElementis being processedxmlElement- theXmlElementto 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 anXmlElementis considered empty.- Parameters:
context- theProcessingContextin which theXmlElementis being processedxmlElement- theXmlElementto process- Returns:
trueif theXmlElementis considered empty
-
accepts
public boolean accepts(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
Determines if the specifiedXmlElementshould be processed.- Specified by:
acceptsin interfaceConditionalElementProcessor<T>- Parameters:
context- theProcessingContextin which theXmlElementis being processedxmlElement- theXmlElementthat would be processed- Returns:
trueif theXmlElementshould be processed- Throws:
ConfigurationException- when a configuration problem was encountered
-
process
public final T process(ProcessingContext context, XmlElement xmlElement) throws ConfigurationException
Process anXmlElementto return a specific type of value.- Specified by:
processin interfaceElementProcessor<T>- Parameters:
context- theProcessingContextin which theXmlElementis being processedxmlElement- theXmlElementto process- Returns:
- a value of type T
- Throws:
ConfigurationException- when a configuration problem was encountered
-
-