Class AbstractReadHandlerFactory<T extends XmlReadHandler>


  • 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 Detail

      • AbstractReadHandlerFactory

        protected AbstractReadHandlerFactory()
        A default-constructor.
    • 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.