|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.config.xml.AbstractNamespaceHandler
public abstract class AbstractNamespaceHandler
An AbstractNamespaceHandler
provides a base implementation of a NamespaceHandler
with support for implicit and explicit registration of ElementProcessor
s and AttributeProcessor
s for those xml attributes and elements occurring in the associated xml namespace.
Constructor Summary | |
---|---|
AbstractNamespaceHandler() Construct an AbstractNamespaceHandler . |
Method Summary | |
---|---|
AttributeProcessor |
getAttributeProcessor(java.lang.String localName) Obtains the AttributeProcessor registered with the specified localName (in the namespace). |
AttributeProcessor |
getAttributeProcessor(XmlAttribute attribute) Obtains the AttributeProcessor that is suitable for processing the specified XmlAttribute in the xml namespace associated with this NamespaceHandler . |
DocumentPreprocessor |
getDocumentPreprocessor() Obtains the DocumentPreprocessor that must be applied to the XmlElement (ie: document) in which the NamespaceHandler is defined, prior to XmlElement s and XmlAttribute s being processed defined by this NamespaceHandler . |
ElementProcessor |
getElementProcessor(java.lang.String localName) Obtains the ElementProcessor registered with the specified localName (in the namespace). |
ElementProcessor |
getElementProcessor(XmlElement element) Obtains the ElementProcessor that is suitable for processing the specified XmlElement in the xml namespace associated with this NamespaceHandler . |
void |
onEndNamespace(ProcessingContext context, XmlElement element, java.lang.String prefix, java.net.URI uri) Called when the xml namespace associated with the NamespaceHandler is last encountered in an xml document. |
void |
onStartNamespace(ProcessingContext context, XmlElement element, java.lang.String prefix, java.net.URI uri) Called when the xml namespace associated with the NamespaceHandler is first encountered in an xml document. |
protected AttributeProcessor |
onUnknownAttribute(XmlAttribute attribute) A call-back to handle when an XmlAttribute is unknown to the NamespaceHandler . |
protected ElementProcessor |
onUnknownElement(XmlElement element) A call-back to handle when an XmlElement is unknown to the NamespaceHandler . |
void |
registerAttributeType(java.lang.String sLocalName, java.lang.Class clzType) Registers (internally creates) an appropriate AttributeProcessor for XmlAttribute s with the specified local name so that they produce the specified type of value when processed. |
void |
registerElementType(java.lang.String sLocalName, java.lang.Class clzType) Registers (internally creates) an appropriate ElementProcessor for XmlElement s with the specified local name so that they produce the specified type of value when processed. |
void |
registerProcessor(java.lang.Class clzProcessor) Registers the specified processor as an ElementProcessor or AttributeProcessor (based on the interfaces it implements) using the XmlSimpleName annotation to determine the localName of the said processor. |
void |
registerProcessor(java.lang.String sLocalName, AttributeProcessor processor) Registers an AttributeProcessor for XmlAttribute s with the specified name. |
void |
registerProcessor(java.lang.String sLocalName, ElementProcessor processor) Registers an ElementProcessor for XmlElement s with a name with in the context of the NamespaceHandler namespace. |
void |
setDocumentPreprocessor(DocumentPreprocessor preprocessor) Sets the DocumentPreprocessor for the NamespaceHandler . |
Constructor Detail |
---|
public AbstractNamespaceHandler()
AbstractNamespaceHandler
.Method Detail |
---|
public DocumentPreprocessor getDocumentPreprocessor()
DocumentPreprocessor
that must be applied to the XmlElement
(ie: document) in which the NamespaceHandler
is defined, prior to XmlElement
s and XmlAttribute
s being processed defined by this NamespaceHandler
.getDocumentPreprocessor
in interface NamespaceHandler
DocumentPreprocessor
or null
if one is not required or defined for the NamespaceHandler
public AttributeProcessor getAttributeProcessor(XmlAttribute attribute)
AttributeProcessor
that is suitable for processing the specified XmlAttribute
in the xml namespace associated with this NamespaceHandler
.getAttributeProcessor
in interface NamespaceHandler
attribute
- the XmlAttribute
AttributeProcessor
or null
if a suitable AttributeProcessor
could not be foundpublic ElementProcessor getElementProcessor(XmlElement element)
ElementProcessor
that is suitable for processing the specified XmlElement
in the xml namespace associated with this NamespaceHandler
.getElementProcessor
in interface NamespaceHandler
element
- the XmlElement
ElementProcessor
or null
if a suitable ElementProcessor
could not be foundpublic void onStartNamespace(ProcessingContext context, XmlElement element, java.lang.String prefix, java.net.URI uri)
NamespaceHandler
is first encountered in an xml document.onStartNamespace
in interface NamespaceHandler
context
- the document ProcessingContext
in which the xml namespace was encounteredelement
- the XmlElement
in which the xml namespace was encounteredprefix
- the prefix of the declared xml namespaceuri
- the URI
of the declared xml namespacepublic void onEndNamespace(ProcessingContext context, XmlElement element, java.lang.String prefix, java.net.URI uri)
NamespaceHandler
is last encountered in an xml document.onEndNamespace
in interface NamespaceHandler
context
- the document ProcessingContext
in which the xml namespace was encounteredelement
- the XmlElement
in which the xml namespace was encounteredprefix
- the prefix of the declared xml namespaceuri
- the URI
of the declared xml namespacepublic void setDocumentPreprocessor(DocumentPreprocessor preprocessor)
DocumentPreprocessor
for the NamespaceHandler
.preprocessor
- the DocumentPreprocessor
public void registerProcessor(java.lang.Class clzProcessor)
ElementProcessor
or AttributeProcessor
(based on the interfaces it implements) using the XmlSimpleName
annotation to determine the localName of the said processor.
Note: The specified class must have a no-args constructor.
clzProcessor
- A class that implements either (or both) ElementProcessor
or AttributeProcessor
that is annotated with @XmlSimpleName
to specify it's localName.public void registerProcessor(java.lang.String sLocalName, ElementProcessor processor)
ElementProcessor
for XmlElement
s with a name with in the context of the NamespaceHandler
namespace.sLocalName
- The local name of the XmlElement
to be processed with the ElementProcessor
processor
- The ElementProcessor
public void registerProcessor(java.lang.String sLocalName, AttributeProcessor processor)
AttributeProcessor
for XmlAttribute
s with the specified name.sLocalName
- The local name of the XmlAttribute
to be processed with the AttributeProcessor
processor
- The AttributeProcessor
public void registerElementType(java.lang.String sLocalName, java.lang.Class clzType)
ElementProcessor
for XmlElement
s with the specified local name so that they produce the specified type of value when processed.sLocalName
- The local name of the XmlElement
s to be associated with the typeclzType
- The Class
of value that should be produced for the XmlElement
public void registerAttributeType(java.lang.String sLocalName, java.lang.Class clzType)
AttributeProcessor
for XmlAttribute
s with the specified local name so that they produce the specified type of value when processed.sLocalName
- The local name of the XmlElement
s to be associated with the typeclzType
- The Class
of value that should be produced for the XmlAttribute
protected AttributeProcessor onUnknownAttribute(XmlAttribute attribute)
XmlAttribute
is unknown to the NamespaceHandler
.
Override this method to provide specialized foreign XmlAttribute
processing. By default, null
will be returned for unknown XmlAttribute
s.
attribute
- The XmlAttribute
that was unknown.AttributeProcessor
that may be used to process the unknown XmlAttribute
or null
if no special processing should occur.protected ElementProcessor onUnknownElement(XmlElement element)
XmlElement
is unknown to the NamespaceHandler
.
Override this method to provide specialized foreign XmlElement
processing. By default, unknown XmlElement
will return an ElementProcessor
that when attempting to process the said element, will throw a ConfigurationException
.
element
- The XmlElement
that was unknown.ElementProcessor
that may be used to process the unknown XmlElement
or null
if no special processing should occur.public AttributeProcessor getAttributeProcessor(java.lang.String localName)
AttributeProcessor
registered with the specified localName (in the namespace).localName
- the name of the AttributeProcessor
to returnAttributeProcessor
or null
if not foundpublic ElementProcessor getElementProcessor(java.lang.String localName)
ElementProcessor
registered with the specified localName (in the namespace).localName
- the name of the ElementProcessor
to returnElementProcessor
or null
if not found
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |