Class XmlOutputAbstractImpl

    • Field Detail

      • nsUriIndex2prefixIndex

        protected int[] nsUriIndex2prefixIndex
        The conversion table from the namespace URI index to prefix index. This array is shared with XMLSerializer and is updated by it automatically. This allows Name.nsUriIndex to be converted to prefix index (for NamespaceContextImpl) quickly.
      • nsContext

        protected NamespaceContextImpl nsContext
        Set by the marshaller before the start tag is written for the root element.
    • Constructor Detail

      • XmlOutputAbstractImpl

        public XmlOutputAbstractImpl()
    • Method Detail

      • startDocument

        public void startDocument​(XMLSerializer serializer,
                                  boolean fragment,
                                  int[] nsUriIndex2prefixIndex,
                                  NamespaceContextImpl nsContext)
                           throws java.io.IOException,
                                  org.xml.sax.SAXException,
                                  javax.xml.stream.XMLStreamException
        Called at the very beginning.
        Specified by:
        startDocument in interface XmlOutput
        Parameters:
        serializer - the XMLSerializer that coordinates this whole marshalling episode.
        fragment - true if we are marshalling a fragment.
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.stream.XMLStreamException
      • endDocument

        public void endDocument​(boolean fragment)
                         throws java.io.IOException,
                                org.xml.sax.SAXException,
                                javax.xml.stream.XMLStreamException
        Called at the very end.
        Specified by:
        endDocument in interface XmlOutput
        Parameters:
        fragment - false if we are writing the whole document.
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.stream.XMLStreamException
      • beginStartTag

        public void beginStartTag​(Name name)
                           throws java.io.IOException,
                                  javax.xml.stream.XMLStreamException
        Writes a start tag.

        At this point nsContext holds namespace declarations needed for this new element.

        This method is used for writing tags that are indexed.

        Specified by:
        beginStartTag in interface XmlOutput
        Throws:
        java.io.IOException
        javax.xml.stream.XMLStreamException
      • beginStartTag

        public abstract void beginStartTag​(int prefix,
                                           java.lang.String localName)
                                    throws java.io.IOException,
                                           javax.xml.stream.XMLStreamException
        Specified by:
        beginStartTag in interface XmlOutput
        Throws:
        java.io.IOException
        javax.xml.stream.XMLStreamException
      • attribute

        public void attribute​(Name name,
                              java.lang.String value)
                       throws java.io.IOException,
                              javax.xml.stream.XMLStreamException
        Specified by:
        attribute in interface XmlOutput
        Throws:
        java.io.IOException
        javax.xml.stream.XMLStreamException
      • attribute

        public abstract void attribute​(int prefix,
                                       java.lang.String localName,
                                       java.lang.String value)
                                throws java.io.IOException,
                                       javax.xml.stream.XMLStreamException
        Specified by:
        attribute in interface XmlOutput
        Parameters:
        prefix - -1 if this attribute does not have a prefix (this handling differs from that of elements.)
        Throws:
        java.io.IOException
        javax.xml.stream.XMLStreamException
      • endStartTag

        public abstract void endStartTag()
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
        Specified by:
        endStartTag in interface XmlOutput
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • endTag

        public void endTag​(Name name)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           javax.xml.stream.XMLStreamException
        Specified by:
        endTag in interface XmlOutput
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.stream.XMLStreamException
      • endTag

        public abstract void endTag​(int prefix,
                                    java.lang.String localName)
                             throws java.io.IOException,
                                    org.xml.sax.SAXException,
                                    javax.xml.stream.XMLStreamException
        Specified by:
        endTag in interface XmlOutput
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.stream.XMLStreamException