org.pentaho.reporting.libraries.xmlns.parser
public abstract class AbstractXmlResourceFactory extends Object implements ResourceFactory
Field Summary | |
---|---|
static String | CONTENTBASE_KEY
A key for the content base. |
Constructor Summary | |
---|---|
protected | AbstractXmlResourceFactory()
Default-Constructor. |
Method Summary | |
---|---|
protected void | configureReader(XMLReader reader, MultiplexRootElementHandler handler)
Configures the xml reader. |
Resource | create(ResourceManager manager, ResourceData data, ResourceKey context)
Creates a resource by interpreting the data given in the resource-data object. |
protected Resource | createResource(ResourceKey targetKey, MultiplexRootElementHandler handler, Object createdProduct)
Creates a Resource object for the given product. |
protected Object | finishResult(Object res, ResourceManager manager, ResourceData data, ResourceKey context)
Finishes up the result. |
protected abstract Configuration | getConfiguration()
Returns the configuration that should be used to initialize this factory.
|
protected ErrorHandler | getErrorHandler()
Returns the XML-Error handler that should be registered with the XML parser. |
protected SAXParser | getParser()
Returns a SAX parser.
|
void | initializeDefaults()
Loads all XmlFactoryModule-implementations from the given configuration.
|
Object | parseDirectly(ResourceManager manager, InputSource input, ResourceKey context, 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. |
Parameters: handler the parser implementation that will handle the SAX-Callbacks. reader the xml reader that should be configured.
Parameters: 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.
Returns: the parsed result, never null.
Throws: ResourceCreationException if the resource could not be parsed due to syntaxctial or logical errors in the data. ResourceLoadingException if the resource could not be accessed from the physical storage.
Parameters: targetKey the target key. handler the root handler used for the parsing. createdProduct the created product.
Returns: the product wrapped into a resource object.
Parameters: 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.
Returns: the parsed resource.
Throws: ResourceCreationException if the post initialization fails. ResourceLoadingException if loading external resources failed with an IO error.
Returns: the configuration for initializing the factory.
Returns: the error handler.
Returns: a SAXParser.
Throws: ParserConfigurationException if there is a problem configuring the parser. SAXException if there is a problem with the parser initialisation
See Also: getConfiguration
Parameters: 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.
Returns: the parsed result, never null.
Throws: ResourceCreationException if the resource could not be parsed due to syntaxctial or logical errors in the data. ResourceLoadingException if the resource could not be accessed from the physical storage. ResourceKeyCreationException if creating the context key failed.
Parameters: factoryModule the factory module.
Throws: NullPointerException if the module given is null.