Class EmbeddedXMLObject


  • public class EmbeddedXMLObject
    extends EmbeddedObject
    This class represents those embedded objects in an ODF document that have an XML representation: Formulas, charts, spreadsheets, text, drawings and presentations. These object types are stored using a combination of content, settings and styles XML files. The settings are application specific and ignored.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.w3c.dom.Document contentDOM  
      protected org.w3c.dom.Document stylesDOM  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected EmbeddedXMLObject​(java.lang.String sName, java.lang.String sType, OfficeDocument doc, SimpleZipReader source)
      Read an object from an ODF package document
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Dispose this EmbeddedObject.
      org.w3c.dom.Document getContentDOM()
      Returns the content data for this embedded object.
      org.w3c.dom.Document getStylesDOM()
      Returns the style data for this embedded object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • contentDOM

        protected org.w3c.dom.Document contentDOM
      • stylesDOM

        protected org.w3c.dom.Document stylesDOM
    • Constructor Detail

      • EmbeddedXMLObject

        protected EmbeddedXMLObject​(java.lang.String sName,
                                    java.lang.String sType,
                                    OfficeDocument doc,
                                    SimpleZipReader source)
        Read an object from an ODF package document
        Parameters:
        sName - The name of the object.
        sType - The MIME-type of the object.
        source - A ZIP reader providing the contents of the package
    • Method Detail

      • getContentDOM

        public org.w3c.dom.Document getContentDOM()
                                           throws org.xml.sax.SAXException,
                                                  java.io.IOException
        Returns the content data for this embedded object.
        Returns:
        DOM representation of "content.xml"
        Throws:
        org.xml.sax.SAXException - If any parser error occurs
        java.io.IOException - If any IO error occurs
      • getStylesDOM

        public org.w3c.dom.Document getStylesDOM()
                                          throws org.xml.sax.SAXException,
                                                 java.io.IOException
        Returns the style data for this embedded object.
        Returns:
        DOM representation of "styles.xml"
        Throws:
        org.xml.sax.SAXException - If any parser error occurs
        java.io.IOException - If any IO error occurs
      • dispose

        public void dispose()
        Description copied from class: EmbeddedObject
        Dispose this EmbeddedObject. This implies that the content is nullified and the object is removed from the collection in the OfficeDocument.
        Overrides:
        dispose in class EmbeddedObject