Class RootXmlReadHandler

    • Constructor Detail

      • RootXmlReadHandler

        public RootXmlReadHandler()
        Creates a new root SAX handler.
    • Method Detail

      • addDefaultMappings

        protected void addDefaultMappings()
        Adds the default mappings.
      • getFactoryLoader

        public abstract ObjectFactory getFactoryLoader()
        Returns the object factory.
        Returns:
        The object factory.
      • addManualMapping

        protected void addManualMapping​(Class classToRead,
                                        Class handler)
        Adds a mapping between a class and the handler for the class.
        Parameters:
        classToRead - the class.
        handler - the handler class.
      • addMultiplexMapping

        protected void addMultiplexMapping​(Class baseClass,
                                           String typeAttr,
                                           MultiplexMappingEntry[] mdef)
        Adds a multiplex mapping.
        Parameters:
        baseClass - the base class.
        typeAttr - the type attribute.
        mdef - the mapping entry.
      • setHelperObject

        public void setHelperObject​(String key,
                                    Object value)
        Adds an object to the registry.
        Parameters:
        key - the key.
        value - the object.
      • getHelperObject

        public Object getHelperObject​(String key)
        Returns an object from the registry.
        Parameters:
        key - the key.
        Returns:
        The object.
      • createHandler

        public XmlReadHandler createHandler​(Class classToRead,
                                            String tagName,
                                            Attributes atts)
                                     throws XmlReaderException
        Creates a SAX handler for the specified class.
        Parameters:
        classToRead - the class.
        tagName - the tag name.
        atts - the attributes.
        Returns:
        a SAX handler.
        Throws:
        XmlReaderException - if there is a problem with the reader.
      • setRootHandler

        protected void setRootHandler​(XmlReadHandler handler)
        Sets the root SAX handler.
        Parameters:
        handler - the SAX handler.
      • getRootHandler

        protected XmlReadHandler getRootHandler()
        Returns the root SAX handler.
        Returns:
        the root SAX handler.
      • getCurrentHandler

        protected XmlReadHandler getCurrentHandler()
        Returns the current handler.
        Returns:
        The current handler.
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws SAXException
        Process character data.
        Specified by:
        characters in interface ContentHandler
        Overrides:
        characters in class DefaultHandler
        Parameters:
        ch - the character buffer.
        start - the start index.
        length - the length of the character data.
        Throws:
        SAXException - if there is a parsing error.
      • loadHandlerClass

        protected XmlReadHandler loadHandlerClass​(String className)
                                           throws XmlReaderException
        Loads the given class, and ignores all exceptions which may occur during the loading. If the class was invalid, null is returned instead.
        Parameters:
        className - the name of the class to be loaded.
        Returns:
        the class or null.
        Throws:
        XmlReaderException - if there is a reader error.
      • loadClass

        protected Class loadClass​(String className)
                           throws XmlReaderException
        Loads the given class, and ignores all exceptions which may occur during the loading. If the class was invalid, null is returned instead.
        Parameters:
        className - the name of the class to be loaded.
        Returns:
        the class or null.
        Throws:
        XmlReaderException - if there is a reader error.