org.odftoolkit.odfdom
Class OdfFileDom

java.lang.Object
  extended by org.apache.xerces.dom.NodeImpl
      extended by org.apache.xerces.dom.ChildNode
          extended by org.apache.xerces.dom.ParentNode
              extended by org.apache.xerces.dom.CoreDocumentImpl
                  extended by org.apache.xerces.dom.DocumentImpl
                      extended by org.odftoolkit.odfdom.OdfFileDom
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.w3c.dom.Document, org.w3c.dom.events.DocumentEvent, org.w3c.dom.events.EventTarget, org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.ranges.DocumentRange, org.w3c.dom.traversal.DocumentTraversal

public class OdfFileDom
extends org.apache.xerces.dom.DocumentImpl

The DOM repesentation of an XML file within the ODF document.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.xerces.dom.DocumentImpl
eventListeners, iterators, mutationEvents, ranges
 
Fields inherited from class org.apache.xerces.dom.CoreDocumentImpl
actualEncoding, allowGrammarAccess, changes, docElement, docType, encoding, errorChecking, fDocumentURI, identifiers, standalone, userData, version, xmlVersionChanged
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
OdfFileDom(OdfDocument odfDocument, java.lang.String packagePath)
          Creates the DOM representation of an XML file of an Odf document.
 
Method Summary
 OdfAttribute createAttribute(java.lang.String name)
          Create the ODF attribute with its name
 OdfAttribute createAttributeNS(OdfName name)
          Create the ODF attribute with ODF name
 OdfAttribute createAttributeNS(java.lang.String nsuri, java.lang.String qname)
          Create the ODF attribute with namespace uri and qname
 OdfElement createElement(java.lang.String name)
          Create ODF element with namespace uri and qname
 OdfElement createElementNS(OdfName name)
          Create ODF element with ODF name
 OdfElement createElementNS(java.lang.String nsuri, java.lang.String qname)
          Create ODF element with namespace uri and qname
 OdfOfficeAutomaticStyles getAutomaticStyles()
          Retrieve the ODF AutomaticStyles
 OdfDocument getOdfDocument()
          Retrieves the Odf Document
 OdfOfficeStyles getOfficeStyles()
           
 OdfOfficeAutomaticStyles getOrCreateAutomaticStyles()
           
 java.lang.String getPackagePath()
          Retrieves the String of Package Path
 OdfElement getRootElement()
          Retrieves the ODF root element.
<T extends OdfElement>
T
newOdfElement(java.lang.Class<T> clazz)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.xerces.dom.DocumentImpl
addEventListener, cloneNode, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, dispatchingEventToSubtree, getEventListeners, getImplementation, removeEventListener, saveEnclosingAttr, setEventListeners
 
Methods inherited from class org.apache.xerces.dom.CoreDocumentImpl
abort, adoptNode, callUserDataHandlers, changed, changes, checkDOMNSErr, checkNamespaceWF, checkQName, clearIdentifiers, clone, cloneNode, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElementDefinition, createElementNS, createEntity, createEntityReference, createNotation, createProcessingInstruction, createTextNode, getAsync, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getErrorChecking, getFeature, getIdentifier, getIdentifiers, getInputEncoding, getNodeName, getNodeNumber, getNodeNumber, getNodeType, getOwnerDocument, getStandalone, getStrictErrorChecking, getTextContent, getUserData, getUserData, getUserDataRecord, getVersion, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, insertBefore, isKidOK, isValidQName, isXMLName, load, loadXML, normalizeDocument, putIdentifier, removeChild, removeIdentifier, renameNode, replaceChild, saveXML, setAsync, setDocumentURI, setEncoding, setErrorChecking, setInputEncoding, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setUserData, setVersion, setXmlEncoding, setXmlStandalone, setXmlVersion, undeferChildren
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, hasChildNodes, isEqualNode, item, normalize, setOwnerDocument, setReadOnly, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getContainer, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, hasAttributes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setPrefix, setUserData, setUserData, synchronizeData
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, compareDocumentPosition, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, setNodeValue, setPrefix, setUserData
 

Constructor Detail

OdfFileDom

public OdfFileDom(OdfDocument odfDocument,
                  java.lang.String packagePath)
Creates the DOM representation of an XML file of an Odf document.

Parameters:
odfDocument - the document the XML files belongs to
packagePath - the internal package path to the XML file
Method Detail

getOdfDocument

public OdfDocument getOdfDocument()
Retrieves the Odf Document

Returns:
The OdfElement

getPackagePath

public java.lang.String getPackagePath()
Retrieves the String of Package Path

Returns:
The path of package

getRootElement

public OdfElement getRootElement()
Retrieves the ODF root element.

Returns:
The OdfElement being the root of the document.

createElement

public OdfElement createElement(java.lang.String name)
                         throws org.w3c.dom.DOMException
Create ODF element with namespace uri and qname

Specified by:
createElement in interface org.w3c.dom.Document
Overrides:
createElement in class org.apache.xerces.dom.CoreDocumentImpl
Parameters:
name - The element name
Throws:
org.w3c.dom.DOMException

createElementNS

public OdfElement createElementNS(java.lang.String nsuri,
                                  java.lang.String qname)
                           throws org.w3c.dom.DOMException
Create ODF element with namespace uri and qname

Specified by:
createElementNS in interface org.w3c.dom.Document
Overrides:
createElementNS in class org.apache.xerces.dom.CoreDocumentImpl
Parameters:
nsuri - The namespace uri
qname - The element qname
Throws:
org.w3c.dom.DOMException

createElementNS

public OdfElement createElementNS(OdfName name)
                           throws org.w3c.dom.DOMException
Create ODF element with ODF name

Parameters:
name - The OdfName
Returns:
The OdfElement
Throws:
org.w3c.dom.DOMException

createAttribute

public OdfAttribute createAttribute(java.lang.String name)
                             throws org.w3c.dom.DOMException
Create the ODF attribute with its name

Specified by:
createAttribute in interface org.w3c.dom.Document
Overrides:
createAttribute in class org.apache.xerces.dom.CoreDocumentImpl
Parameters:
name - the attribute qname
Returns:
The OdfAttribute
Throws:
org.w3c.dom.DOMException

createAttributeNS

public OdfAttribute createAttributeNS(java.lang.String nsuri,
                                      java.lang.String qname)
                               throws org.w3c.dom.DOMException
Create the ODF attribute with namespace uri and qname

Specified by:
createAttributeNS in interface org.w3c.dom.Document
Overrides:
createAttributeNS in class org.apache.xerces.dom.CoreDocumentImpl
Parameters:
nsuri - The namespace uri
qname - the attribute qname
Returns:
The OdfAttribute
Throws:
org.w3c.dom.DOMException

createAttributeNS

public OdfAttribute createAttributeNS(OdfName name)
                               throws org.w3c.dom.DOMException
Create the ODF attribute with ODF name

Parameters:
name - The OdfName
Returns:
The OdfAttribute
Throws:
org.w3c.dom.DOMException

newOdfElement

public <T extends OdfElement> T newOdfElement(java.lang.Class<T> clazz)

getOfficeStyles

public OdfOfficeStyles getOfficeStyles()
Returns:
the style:office-styles element of this dom. May return null if there is not yet such element in this dom.
See Also:
getOrCreateAutomaticStyles()

getAutomaticStyles

public OdfOfficeAutomaticStyles getAutomaticStyles()
Retrieve the ODF AutomaticStyles

Returns:
the element of this dom. May return null if there is not yet such element in this dom.
See Also:
getOrCreateAutomaticStyles()

getOrCreateAutomaticStyles

public OdfOfficeAutomaticStyles getOrCreateAutomaticStyles()
Returns:
the element of this dom. If it does not yet exists, a new one is inserted into the dom and returned.

toString

public java.lang.String toString()
Overrides:
toString in class org.apache.xerces.dom.NodeImpl


Copyright © 2008-2010 ODF Toolkit Project. All Rights Reserved.