Class AbstractXmlFactoryModule

  • All Implemented Interfaces:
    XmlFactoryModule

    public abstract class AbstractXmlFactoryModule
    extends Object
    implements XmlFactoryModule
    A common base class for all XmlFactoryModules. Almost all XmlFactoryModules follow the same pattern and this class provides a sensible default implementation for a module checking for a well-known namespace and root-element.
    Author:
    Thomas Morgner.
    • Constructor Detail

      • AbstractXmlFactoryModule

        protected AbstractXmlFactoryModule​(String namespace,
                                           String rootElementName)
    • Method Detail

      • getDocumentSupport

        public 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.
        Specified by:
        getDocumentSupport in interface XmlFactoryModule
        Parameters:
        documentInfo - the document information collection.
        Returns:
        an integer value indicating how good the document matches the factories requirements.
      • getDefaultNamespace

        public String getDefaultNamespace​(XmlDocumentInfo documentInfo)
        Returns the default namespace for a document with the characteristics given in the XmlDocumentInfo.
        Specified by:
        getDefaultNamespace in interface XmlFactoryModule
        Parameters:
        documentInfo - the document information.
        Returns:
        the default namespace uri for the document.