Class FlatXmlUnmarshaller.HandlerImpl

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

    protected static class FlatXmlUnmarshaller.HandlerImpl
    extends org.xml.sax.helpers.DefaultHandler
    Handler to load XML values onto target object.
    • 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

      • ATTRIBUTE_SEPARATOR

        protected static final char ATTRIBUTE_SEPARATOR
        Separator of the attribute and element name for loading.
        See Also:
        Constant Field Values
      • targetObject

        protected java.lang.Object targetObject
        Target object to load XML values on.
      • elementValue

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

      • HandlerImpl

        public HandlerImpl​(FlatXmlUnmarshallerMetaData metaData)
        Initiate with meta-data.
        Parameters:
        metaData - Meta-data for unmarshalling the XML.
    • 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