Class MultiplexRootElementHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.pentaho.reporting.libraries.xmlns.parser.RootXmlReadHandler
-
- org.pentaho.reporting.libraries.xmlns.parser.MultiplexRootElementHandler
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class MultiplexRootElementHandler extends RootXmlReadHandler
A root-handler that intercepts the first call to startElement to select a XmlReadHandler based on the XmlDocumentInfo provided by the parser.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description MultiplexRootElementHandler(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager, org.pentaho.reporting.libraries.resourceloader.ResourceKey source, org.pentaho.reporting.libraries.resourceloader.ResourceKey context, long version, XmlFactoryModule[] rootHandlers)Creates a new MultiplexRootElementHandler for the given root handler selection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityResolvergetEntityResolver()Returns the entity resolver used in this handler.ParserEntityResolvergetParserEntityResolver()Returns the parent entity resolver used in the element handler.protected XmlFactoryModule[]getRootHandlers()Returns all known roothandlers.XmlFactoryModulegetSelectedRootHandler()protected voidinterceptFirstStartElement(String originalUri, String localName, String qName, Attributes attributes)Starts processing an element.-
Methods inherited from class org.pentaho.reporting.libraries.xmlns.parser.RootXmlReadHandler
characters, delegate, endElement, getCommentHandler, getContext, getCurrentHandler, getDependencyCollector, getDocumentLocator, getHelperObject, getHelperObjectNames, getParserConfiguration, getResourceManager, getResult, getRootHandler, getSource, installRootHandler, isFirstCall, isXmlnsUrisNotAvailable, pushDefaultNamespace, recurse, setDocumentLocator, setHelperObject, setRootHandler, setXmlnsUrisNotAvailable, startDocument, startElement, unwind, wrapAttributes
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
MultiplexRootElementHandler
public MultiplexRootElementHandler(org.pentaho.reporting.libraries.resourceloader.ResourceManager manager, org.pentaho.reporting.libraries.resourceloader.ResourceKey source, org.pentaho.reporting.libraries.resourceloader.ResourceKey context, long version, XmlFactoryModule[] rootHandlers)Creates a new MultiplexRootElementHandler for the given root handler selection.- Parameters:
manager- the resource manager that loaded this xml-file.source- the source-key that idenfies from where the file was loaded.context- the key that should be used to resolve relative paths.version- the versioning information for the root-file.rootHandlers- the roothandlers, never null.
-
-
Method Detail
-
getEntityResolver
public EntityResolver getEntityResolver()
Returns the entity resolver used in this handler.- Overrides:
getEntityResolverin classRootXmlReadHandler- Returns:
- the entity resolver.
-
getParserEntityResolver
public ParserEntityResolver getParserEntityResolver()
Returns the parent entity resolver used in the element handler. This returns the modifiable entity-resolver backend.- Returns:
- the entity resolver.
-
getRootHandlers
protected XmlFactoryModule[] getRootHandlers()
Returns all known roothandlers.- Returns:
- the known root handlers.
-
interceptFirstStartElement
protected void interceptFirstStartElement(String originalUri, String localName, String qName, Attributes attributes) throws SAXException
Starts processing an element.- Overrides:
interceptFirstStartElementin classRootXmlReadHandler- Parameters:
originalUri- the URI.localName- the local name.qName- the qName.attributes- the attributes.- Throws:
SAXException- if there is a parsing problem.
-
getSelectedRootHandler
public XmlFactoryModule getSelectedRootHandler()
-
-