Interface XmlFactoryModule
- All Known Implementing Classes:
AbstractXmlFactoryModule
public interface XmlFactoryModule
The XmlFactoryModule is the base of a plugin-structure to allow parser-multiplexing. In that case, the actual
implementation of the parser will be selected according to the DTD, Namespace or root-tag of the document.
- Author:
- Thomas Morgner
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
A constant declaring that the content has NOT been recognized by any mean.static final int
A constant declaring that the content has been recognized by the declared Document Type Declaration (DTD).static final int
A constant declaring that the content has been recognized by the declared namespace.static final int
A constant declaring that the content has been recognized by the tagname of the root-element of the XML-document. -
Method Summary
Modifier and TypeMethodDescriptioncreateReadHandler
(XmlDocumentInfo documentInfo) Creates an XmlReadHandler for the root-tag based on the given document information.getDefaultNamespace
(XmlDocumentInfo documentInfo) Returns the default namespace for a document with the characteristics given in the XmlDocumentInfo.int
getDocumentSupport
(XmlDocumentInfo documentInfo) Checks the given document data to compute the propability of whether this factory module would be able to handle the given data.
-
Field Details
-
RECOGNIZED_BY_NAMESPACE
static final int RECOGNIZED_BY_NAMESPACEA constant declaring that the content has been recognized by the declared namespace.- See Also:
-
RECOGNIZED_BY_DTD
static final int RECOGNIZED_BY_DTDA constant declaring that the content has been recognized by the declared Document Type Declaration (DTD).- See Also:
-
RECOGNIZED_BY_TAGNAME
static final int RECOGNIZED_BY_TAGNAMEA constant declaring that the content has been recognized by the tagname of the root-element of the XML-document.- See Also:
-
NOT_RECOGNIZED
static final int NOT_RECOGNIZEDA constant declaring that the content has NOT been recognized by any mean.- See Also:
-
-
Method Details
-
getDocumentSupport
Checks the given document data to compute the propability of whether this factory module would be able to handle the given data.- Parameters:
documentInfo
- the document information collection.- Returns:
- an integer value indicating how good the document matches the factories requirements.
-
createReadHandler
Creates an XmlReadHandler for the root-tag based on the given document information.- Parameters:
documentInfo
- the document information that has been extracted from the parser.- Returns:
- the root handler or null.
-
getDefaultNamespace
Returns the default namespace for a document with the characteristics given in the XmlDocumentInfo.- Parameters:
documentInfo
- the document information.- Returns:
- the default namespace uri for the document.
-