Class AbstractReadHandlerFactory<T extends XmlReadHandler>
- java.lang.Object
-
- org.pentaho.reporting.libraries.xmlns.parser.AbstractReadHandlerFactory<T>
-
public abstract class AbstractReadHandlerFactory<T extends XmlReadHandler> extends Object
The AbstractReadHandlerFactory provides a base implementation for all read-handler factories. A read-handler factory decouples the tag-handlers of a SAX parser and allows to configure alternate parser configuations at runtime, resulting in a more flexible parsing process.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractReadHandlerFactory()A default-constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconfigure(org.pentaho.reporting.libraries.base.config.Configuration conf, String prefix)Configures this factory from the given configuration using the specified prefix as filter.voidconfigureGlobal(org.pentaho.reporting.libraries.base.config.Configuration config, String prefix)StringgetDefaultNamespace()TgetHandler(String namespace, String tagname)The returned handler can be null, in case no handler is registered.protected abstract Class<T>getTargetClass()Returns the implementation class for this read-handler factory.voidsetDefaultNamespace(String defaultNamespace)voidsetElementHandler(String tagName, Class<? extends T> hasCData)Adds a configuration entry for the given namespace and tag-name to the tag-descriptions.voidsetElementHandler(String namespaceUri, String tagName, Class<? extends T> hasCData)Adds a configuration entry for the given namespace and tag-name to the tag-descriptions.voidsetNamespaceHandler(String namespaceUri, Class<? extends T> hasCData)Adds a configuration default for the given namespace to the tag-descriptions.
-
-
-
Method Detail
-
configureGlobal
public void configureGlobal(org.pentaho.reporting.libraries.base.config.Configuration config, String prefix)
-
configure
public void configure(org.pentaho.reporting.libraries.base.config.Configuration conf, String prefix)Configures this factory from the given configuration using the specified prefix as filter.- Parameters:
conf- the configuration.prefix- the key-prefix.
-
setNamespaceHandler
public void setNamespaceHandler(String namespaceUri, Class<? extends T> hasCData)
Adds a configuration default for the given namespace to the tag-descriptions. If the namespace URI given here is null, this defines the global default for all namespaces.- Parameters:
namespaceUri- the namespace URI for which a default should be configured.hasCData- the default value.
-
setElementHandler
public void setElementHandler(String namespaceUri, String tagName, Class<? extends T> hasCData)
Adds a configuration entry for the given namespace and tag-name to the tag-descriptions.- Parameters:
namespaceUri- the namespace URI for which a default should be configured.tagName- the tagname for which the entry should be added.hasCData- the default value.
-
setElementHandler
public void setElementHandler(String tagName, Class<? extends T> hasCData)
Adds a configuration entry for the given namespace and tag-name to the tag-descriptions.- Parameters:
tagName- the tagname for which the entry should be added.hasCData- the default value.
-
setDefaultNamespace
public void setDefaultNamespace(String defaultNamespace)
-
getDefaultNamespace
public String getDefaultNamespace()
-
getTargetClass
protected abstract Class<T> getTargetClass()
Returns the implementation class for this read-handler factory.- Returns:
- the implementation class.
-
getHandler
public T getHandler(String namespace, String tagname)
The returned handler can be null, in case no handler is registered.- Parameters:
namespace- the namespace of the xml-tag for which a handler should be returned.tagname- the tagname of the xml-tag.- Returns:
- the instantiated read handler, or null if there is no handler registered.
-
-