org.pentaho.reporting.libraries.xmlns.parser
Class AbstractXmlFactoryModule

java.lang.Object
  extended by org.pentaho.reporting.libraries.xmlns.parser.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.

Field Summary
 
Fields inherited from interface org.pentaho.reporting.libraries.xmlns.parser.XmlFactoryModule
NOT_RECOGNIZED, RECOGNIZED_BY_DTD, RECOGNIZED_BY_NAMESPACE, RECOGNIZED_BY_TAGNAME
 
Method Summary
 String 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pentaho.reporting.libraries.xmlns.parser.XmlFactoryModule
createReadHandler
 

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.