Class XmlUnmarshallingContext

    • Constructor Detail

      • XmlUnmarshallingContext

        public XmlUnmarshallingContext​(int groupDepth)
        Constructs a new XmlUnmarshallingContext
        Parameters:
        groupDepth - the maximum depth of an element mapped to a Group in the DOM
    • Method Detail

      • setRecordValue

        public void setRecordValue​(java.lang.Object value)
        Description copied from class: UnmarshallingContext
        Sets the value of the record returned from the RecordReader
        Specified by:
        setRecordValue in class UnmarshallingContext
        Parameters:
        value - the record value read by a record reader
        See Also:
        RecordReader
      • getPreviousElement

        public org.w3c.dom.Element getPreviousElement()
        Returns the last parsed DOM element for a field or bean collection.
        Returns:
        the last parsed element
      • setPreviousElement

        public void setPreviousElement​(org.w3c.dom.Element e)
        Sets the last parsed DOM element for a field or bean collection.
        Parameters:
        e - the last parsed element
      • getDocument

        public org.w3c.dom.Document getDocument()
        Returns the XML document object model (DOM) for the current record.
        Returns:
        the XML document object model
      • pushPosition

        public org.w3c.dom.Element pushPosition​(XmlNode node,
                                                int depth,
                                                boolean isGroup)
        Updates position by finding a child of the current position that matches a given node. If isGroup is true, the node is indexed by its depth so that calls to this method for subsequent records in the same group can update position according to the depth of the record.
        Parameters:
        node - the XmlNode to match
        depth - the depth of the node in the DOM tree
        isGroup - whether the node is mapped to a Group
        Returns:
        the matched node or null if not matched
      • pushPosition

        public org.w3c.dom.Element pushPosition​(XmlNode node)
        Updates position by finding a child of the current position that matches a given node.
        Parameters:
        node - the XmlNode to match
        Returns:
        the matching element, or null if not found
        See Also:
        getPosition()
      • popPosition

        public void popPosition()
        Updates position to its parent (element), or null if the parent element is the document itself.
        See Also:
        getPosition()
      • findElement

        public org.w3c.dom.Element findElement​(XmlNode node)
        Finds a child element of the current position.
        Parameters:
        node - the XmlNodeUtil
        Returns:
        the matched element or null if not found
      • toRecordValue

        public java.lang.Object toRecordValue​(org.w3c.dom.Node node)
        Description copied from class: UnmarshallingContext
        Converts a Node to a record value.
        Overrides:
        toRecordValue in class UnmarshallingContext
        Parameters:
        node - the Node to convert
        Returns:
        the record value, or null if not supported