Interface XMLizable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void buildFromXMLElement​(org.w3c.dom.Element aElement, XMLParser aParser)
      Initializes this object from its XML DOM representation.
      void buildFromXMLElement​(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)
      Initializes this object from its XML DOM representation.
      void toXML​(java.io.OutputStream aOutputStream)
      Writes this object's XML representation as a string in UTF-8 encoding.
      void toXML​(java.io.Writer aWriter)
      Writes this object's XML representation as a string.
      void toXML​(org.xml.sax.ContentHandler aContentHandler)
      Writes this object's XML representation by making calls on a SAX ContentHandler.
      void toXML​(org.xml.sax.ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
      Writes this object's XML representation by making calls on a SAX ContentHandler.
    • Method Detail

      • toXML

        void toXML​(java.io.Writer aWriter)
            throws org.xml.sax.SAXException,
                   java.io.IOException
        Writes this object's XML representation as a string. Note that if you want to write the XML to a file or to a byte stream, it is highly recommended that you use toXML(OutputStream) instead, as it ensures that output is written in UTF-8 encoding, which is the default encoding that should be used for XML files.

        The XML String that is produced will have a header <?xml version="1.0" encoding="UTF-8"?>. Therefore you should not write this string out in any encoding other than UTF-8 (for example do not use the default platform encoding), or you will produce output that will not be able to be parsed.

        Parameters:
        aWriter - a Writer to which the XML string will be written
        Throws:
        java.io.IOException - if an I/O failure occurs
        org.xml.sax.SAXException - passthru
      • toXML

        void toXML​(java.io.OutputStream aOutputStream)
            throws org.xml.sax.SAXException,
                   java.io.IOException
        Writes this object's XML representation as a string in UTF-8 encoding.
        Parameters:
        aOutputStream - an OutputStream to which the XML string will be written, in UTF-8 encoding.
        Throws:
        java.io.IOException - if an I/O failure occurs
        org.xml.sax.SAXException - pass thru
      • toXML

        void toXML​(org.xml.sax.ContentHandler aContentHandler)
            throws org.xml.sax.SAXException
        Writes this object's XML representation by making calls on a SAX ContentHandler. This method just calls toXML(aContentHandler,false), so subclasses should override that version of this method, not this one.
        Parameters:
        aContentHandler - the content handler to which this object will write events that describe its XML representation.
        Throws:
        org.xml.sax.SAXException - pass thru
      • toXML

        void toXML​(org.xml.sax.ContentHandler aContentHandler,
                   boolean aWriteDefaultNamespaceAttribute)
            throws org.xml.sax.SAXException
        Writes this object's XML representation by making calls on a SAX ContentHandler.
        Parameters:
        aContentHandler - the content handler to which this object will write events that describe its XML representation.
        aWriteDefaultNamespaceAttribute - whether the namespace of this element should be written as the default namespace. This should be done only for the root element, and it defaults to false.
        Throws:
        org.xml.sax.SAXException - pass thru
      • buildFromXMLElement

        void buildFromXMLElement​(org.w3c.dom.Element aElement,
                                 XMLParser aParser)
                          throws InvalidXMLException
        Initializes this object from its XML DOM representation. This method is typically called from the XMLParser.
        Parameters:
        aElement - the XML element that represents this object.
        aParser - a reference to the UIMA XMLParser. The XMLParser.buildObject(Element) method can be used to construct sub-objects.
        Throws:
        InvalidXMLException - if the input XML element does not specify a valid object
      • buildFromXMLElement

        void buildFromXMLElement​(org.w3c.dom.Element aElement,
                                 XMLParser aParser,
                                 XMLParser.ParsingOptions aOptions)
                          throws InvalidXMLException
        Initializes this object from its XML DOM representation. This method is typically called from the XMLParser.
        Parameters:
        aElement - the XML element that represents this object.
        aParser - a reference to the UIMA XMLParser. The XMLParser.buildObject(Element) method can be used to construct sub-objects.
        aOptions - option settings
        Throws:
        InvalidXMLException - if the input XML element does not specify a valid object