Class TreeXmlUnmarshaller.HandlerImpl

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
    Enclosing class:
    TreeXmlUnmarshaller

    public static class TreeXmlUnmarshaller.HandlerImpl
    extends org.xml.sax.helpers.DefaultHandler
    Handler to load XML values onto target object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String elementValue
      Element value.
      protected XmlState state
      State of the XML unmarshalling.
    • Constructor Summary

      Constructors 
      Constructor Description
      HandlerImpl​(XmlState state)
      Initiate with state of XML unmarshalling.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void characters​(char[] ch, int start, int length)
      Handles obtain the value for the element.
      void endElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName)
      Handles loading the value onto the target value.
      void setTargetObject​(java.lang.Object targetObject)
      Sets the target object.
      void startElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
      Handles loading the attribute value on the target value.
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • state

        protected final XmlState state
        State of the XML unmarshalling.
      • elementValue

        protected java.lang.String elementValue
        Element value.
    • Constructor Detail

      • HandlerImpl

        public HandlerImpl​(XmlState state)
        Initiate with state of XML unmarshalling.
        Parameters:
        state - State of XML unmarshalling.
    • Method Detail

      • setTargetObject

        public void setTargetObject​(java.lang.Object targetObject)
        Sets the target object.
        Parameters:
        targetObject - Target object to have values loaded to it.
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes attributes)
                          throws org.xml.sax.SAXException
        Handles loading the attribute value on the target value.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Handles obtain the value for the element.
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Handles loading the value onto the target value.
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException