public interface NamespaceHandler
NamespaceHandler is responsible for defining the DocumentPreprocessor, ElementProcessors and AttributeProcessors required for processing xml content belonging to a specific xml namespace used in an xml document.DocumentPreprocessor, ElementProcessor, AttributeProcessor, DocumentProcessor, AbstractNamespaceHandler| Modifier and Type | Method and Description |
|---|---|
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 XmlElements and XmlAttributes being processed defined by this NamespaceHandler. |
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, String sPrefix, URI uri)
Called when the xml namespace associated with the
NamespaceHandler is last encountered in an xml document. |
void |
onStartNamespace(ProcessingContext context, XmlElement element, String sPrefix, URI uri)
Called when the xml namespace associated with the
NamespaceHandler is first encountered in an xml document. |
DocumentPreprocessor getDocumentPreprocessor()
DocumentPreprocessor that must be applied to the XmlElement (ie: document) in which the NamespaceHandler is defined, prior to XmlElements and XmlAttributes being processed defined by this NamespaceHandler.DocumentPreprocessor or null if one is not required or defined for the NamespaceHandlerAttributeProcessor<?> getAttributeProcessor(XmlAttribute attribute)
AttributeProcessor that is suitable for processing the specified XmlAttribute in the xml namespace associated with this NamespaceHandler.attribute - the XmlAttributeAttributeProcessor or null if a suitable AttributeProcessor could not be foundElementProcessor<?> getElementProcessor(XmlElement element)
ElementProcessor that is suitable for processing the specified XmlElement in the xml namespace associated with this NamespaceHandler.element - the XmlElementElementProcessor or null if a suitable ElementProcessor could not be foundvoid onStartNamespace(ProcessingContext context, XmlElement element, String sPrefix, URI uri)
NamespaceHandler is first encountered in an xml document.context - the document ProcessingContext in which the xml namespace was encounteredelement - the XmlElement in which the xml namespace was encounteredsPrefix - the prefix of the declared xml namespaceuri - the URI of the declared xml namespacevoid onEndNamespace(ProcessingContext context, XmlElement element, String sPrefix, URI uri)
NamespaceHandler is last encountered in an xml document.context - the document ProcessingContext in which the xml namespace was encounteredelement - the XmlElement in which the xml namespace was encounteredsPrefix - the prefix of the declared xml namespaceuri - the URI of the declared xml namespace