|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory
public abstract class AbstractXmlResourceFactory
A base-class for resource-factories that load their resources from XML files. This class provides a multiplexing option. For this, the parser looks at the root-element of the document to be parsed and selects the most suitable XmlFactoryModule implementation registered.
Field Summary | |
---|---|
static java.lang.String |
CONTENTBASE_KEY
A key for the content base. |
Fields inherited from interface org.pentaho.reporting.libraries.resourceloader.ResourceFactory |
---|
CONFIG_PREFIX |
Constructor Summary | |
---|---|
protected |
AbstractXmlResourceFactory()
Default-Constructor. |
Method Summary | |
---|---|
protected void |
configureReader(org.xml.sax.XMLReader reader,
MultiplexRootElementHandler handler)
Configures the xml reader. |
org.pentaho.reporting.libraries.resourceloader.Resource |
create(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager,
org.pentaho.reporting.libraries.resourceloader.ResourceData data,
org.pentaho.reporting.libraries.resourceloader.ResourceKey context)
Creates a resource by interpreting the data given in the resource-data object. |
protected org.pentaho.reporting.libraries.resourceloader.Resource |
createResource(org.pentaho.reporting.libraries.resourceloader.ResourceKey targetKey,
MultiplexRootElementHandler handler,
java.lang.Object createdProduct)
Creates a Resource object for the given product. |
protected java.lang.Object |
finishResult(java.lang.Object res,
org.pentaho.reporting.libraries.resourceloader.ResourceManager manager,
org.pentaho.reporting.libraries.resourceloader.ResourceData data,
org.pentaho.reporting.libraries.resourceloader.ResourceKey context)
Finishes up the result. |
protected abstract org.pentaho.reporting.libraries.base.config.Configuration |
getConfiguration()
Returns the configuration that should be used to initialize this factory. |
protected org.xml.sax.ErrorHandler |
getErrorHandler()
Returns the XML-Error handler that should be registered with the XML parser. |
protected javax.xml.parsers.SAXParser |
getParser()
Returns a SAX parser. |
void |
initializeDefaults()
Loads all XmlFactoryModule-implementations from the given configuration. |
java.lang.Object |
parseDirectly(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager,
org.xml.sax.InputSource input,
org.pentaho.reporting.libraries.resourceloader.ResourceKey context,
java.util.Map parameters)
A method to allow to invoke the parsing without accessing the LibLoader layer. |
void |
registerModule(XmlFactoryModule factoryModule)
Registers a factory module for being used during the parsing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.pentaho.reporting.libraries.resourceloader.ResourceFactory |
---|
getFactoryType |
Field Detail |
---|
public static final java.lang.String CONTENTBASE_KEY
Constructor Detail |
---|
protected AbstractXmlResourceFactory()
Method Detail |
---|
protected javax.xml.parsers.SAXParser getParser() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
- if there is a problem configuring the
parser.
org.xml.sax.SAXException
- if there is a problem with the parser
initialisationprotected void configureReader(org.xml.sax.XMLReader reader, MultiplexRootElementHandler handler)
handler
- the parser implementation that will handle the
SAX-Callbacks.reader
- the xml reader that should be configured.public org.pentaho.reporting.libraries.resourceloader.Resource create(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager, org.pentaho.reporting.libraries.resourceloader.ResourceData data, org.pentaho.reporting.libraries.resourceloader.ResourceKey context) throws org.pentaho.reporting.libraries.resourceloader.ResourceCreationException, org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
create
in interface org.pentaho.reporting.libraries.resourceloader.ResourceFactory
manager
- the resource manager used for all resource loading.data
- the resource-data from where the binary data is read.context
- the resource context used to resolve relative resource paths.
org.pentaho.reporting.libraries.resourceloader.ResourceCreationException
- if the resource could not be parsed due to syntaxctial or logical errors in the data.
org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
- if the resource could not be accessed from the physical storage.public java.lang.Object parseDirectly(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager, org.xml.sax.InputSource input, org.pentaho.reporting.libraries.resourceloader.ResourceKey context, java.util.Map parameters) throws org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException, org.pentaho.reporting.libraries.resourceloader.ResourceCreationException, org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
manager
- the resource manager used for all resource loading.input
- the raw-data given as SAX-InputSource.context
- the resource context used to resolve relative resource paths.parameters
- the parse parameters.
org.pentaho.reporting.libraries.resourceloader.ResourceCreationException
- if the resource could not be parsed due to syntaxctial or logical errors in the data.
org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
- if the resource could not be accessed from the physical storage.
org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
- if creating the context key failed.protected org.pentaho.reporting.libraries.resourceloader.Resource createResource(org.pentaho.reporting.libraries.resourceloader.ResourceKey targetKey, MultiplexRootElementHandler handler, java.lang.Object createdProduct)
targetKey
- the target key.handler
- the root handler used for the parsing.createdProduct
- the created product.
protected java.lang.Object finishResult(java.lang.Object res, org.pentaho.reporting.libraries.resourceloader.ResourceManager manager, org.pentaho.reporting.libraries.resourceloader.ResourceData data, org.pentaho.reporting.libraries.resourceloader.ResourceKey context) throws org.pentaho.reporting.libraries.resourceloader.ResourceCreationException, org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
res
- the parsed resource.manager
- the resource manager that was used to load the resource.data
- the data object from where the resource is loaded.context
- the context that resolves relative resource paths.
org.pentaho.reporting.libraries.resourceloader.ResourceCreationException
- if the post initialization fails.
org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
- if loading external resources failed with an IO error.protected abstract org.pentaho.reporting.libraries.base.config.Configuration getConfiguration()
public void initializeDefaults()
initializeDefaults
in interface org.pentaho.reporting.libraries.resourceloader.ResourceFactory
getConfiguration()
public void registerModule(XmlFactoryModule factoryModule)
factoryModule
- the factory module.
java.lang.NullPointerException
- if the module given is null.protected org.xml.sax.ErrorHandler getErrorHandler()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |