Class XMLMapperImpl

  • All Implemented Interfaces:
    XMLMapper

    final class XMLMapperImpl
    extends java.lang.Object
    implements XMLMapper
    • Field Detail

      • rootElements

        private final java.util.concurrent.ConcurrentMap<javax.xml.namespace.QName,​XMLElementReader<?>> rootElements
      • rootAttributes

        private final java.util.concurrent.ConcurrentMap<javax.xml.namespace.QName,​XMLAttributeReader<?>> rootAttributes
    • Constructor Detail

      • XMLMapperImpl

        XMLMapperImpl()
    • Method Detail

      • parseDocument

        public void parseDocument​(java.lang.Object rootObject,
                                  javax.xml.stream.XMLStreamReader reader)
                           throws javax.xml.stream.XMLStreamException
        Description copied from interface: XMLMapper
        Parse a document. The document must have a known, registered root element which can accept the given root object.
        Specified by:
        parseDocument in interface XMLMapper
        Parameters:
        rootObject - the root object to send in
        reader - the reader from which the document should be read
        Throws:
        javax.xml.stream.XMLStreamException - if an error occurs
      • deparseDocument

        public void deparseDocument​(XMLElementWriter<?> writer,
                                    java.lang.Object rootObject,
                                    javax.xml.stream.XMLStreamWriter streamWriter)
                             throws javax.xml.stream.XMLStreamException
        Description copied from interface: XMLMapper
        Format the element writer's output on to an XML stream writer.
        Specified by:
        deparseDocument in interface XMLMapper
        Parameters:
        writer - the element writer
        rootObject - the root object to send in
        streamWriter - the stream writer
        Throws:
        javax.xml.stream.XMLStreamException - if an exception occurs
      • doDeparse

        private <T> void doDeparse​(XMLElementWriter<?> writer,
                                   T value,
                                   XMLExtendedStreamWriter streamWriter)
                            throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • deparseDocument

        public void deparseDocument​(XMLContentWriter contentWriter,
                                    javax.xml.stream.XMLStreamWriter streamWriter)
                             throws javax.xml.stream.XMLStreamException
        Format the content writer's output on to an XML stream writer.
        Specified by:
        deparseDocument in interface XMLMapper
        Parameters:
        contentWriter - the content writer
        streamWriter - the stream writer
        Throws:
        javax.xml.stream.XMLStreamException - if an exception occurs
      • processNested

        <T> void processNested​(XMLExtendedStreamReader streamReader,
                               T value)
                        throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • processAttribute

        <T> void processAttribute​(javax.xml.stream.XMLStreamReader streamReader,
                                  int index,
                                  T value)
                           throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException