org.enhydra.xml.xmlc
Interface XMLObject

All Superinterfaces:
Document, DocumentInfo, Node
All Known Subinterfaces:
HTMLObject
All Known Implementing Classes:
XMLObjectImpl

public interface XMLObject
extends Document, DocumentInfo

Interface for all compiled XML objects.


Field Summary
static String XMLC_GENERATED_CLASS_FIELD_NAME
          The name of the class field that is used to identify an XMLC generated class.
static String XMLC_SOURCE_FILE_FIELD_NAME
          Field name in the generated class that contains the name of the source file.
 
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
 
Method Summary
 Node adoptNode(Node source)
          See org.w3c.dom.Document#adoptNode
 void buildDocument()
          Generated method to build the DOM.
 XMLObject getDelegate()
          Get the delegate.
 Document getDocument()
          Get the actual document object.
 String getEncoding()
          Get the encoding specified in the document.
 String getMIMEType()
          Get the MIME type associated with the document, or null if none was associated.
 boolean getStandalone()
          See org.w3c.dom.Document#getStandalone
 boolean getStrictErrorChecking()
          See org.w3c.dom.Document#getStrictErrorChecking
 String getVersion()
          See org.w3c.dom.Document#getVersion()
 void setDelegate(XMLObject delegate)
          Set the delegate object.
 void setEncoding(String encoding)
          See org.w3c.dom.Document#setEncoding
 void setStandalone(boolean standalone)
          See org.w3c.dom.Document#setStandalone
 void setStrictErrorChecking(boolean strictErrorChecking)
          See org.w3c.dom.Document#setStrictErrorChecking
 void setVersion(String version)
          See org.w3c.dom.Document#setVersion
 void syncAccessMethods()
          Initialize the fields used by the generated access methods from the current state of the document.
 String toDocument()
          Convert the document to a string representation of the document, that is a string containing XML.
 
Methods inherited from interface org.w3c.dom.Document
createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getInputEncoding, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setXmlStandalone, setXmlVersion
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 
Methods inherited from interface org.enhydra.xml.io.DocumentInfo
isURLAttribute
 

Field Detail

XMLC_GENERATED_CLASS_FIELD_NAME

public static final String XMLC_GENERATED_CLASS_FIELD_NAME
The name of the class field that is used to identify an XMLC generated class. The field will contain a reference to the Class object for the class. This is used to find the XMLC generated class in an inheritance hierarchy.

XMLC_SOURCE_FILE_FIELD_NAME

public static final String XMLC_SOURCE_FILE_FIELD_NAME
Field name in the generated class that contains the name of the source file. This is used to find the source file for recompilation. It is a relative file path, normally the name of the file within the package containing the class.
Method Detail

buildDocument

public void buildDocument()
Generated method to build the DOM. This is normally call by the constructor. However, one of the generated constructors takes a boolean flag to indicate if this should be called automatically. This method may also be called to reinitialize the object to its empty state.

setDelegate

public void setDelegate(XMLObject delegate)
Set the delegate object. Delegation is used to support automatic recompilation of documents into XMLC objects. If the delegate is not null, the methods of the delegate are called to handle most of the methods of this object.
Parameters:
delegate - The delegate object, or null to remove delegation. The delegate must implement the same interface as the derived, generate object.

syncAccessMethods

public void syncAccessMethods()
Initialize the fields used by the generated access methods from the current state of the document. Missing DOM element ids will result in their acccess method returning null.

getDelegate

public XMLObject getDelegate()
Get the delegate.
Returns:
The delegate object, or null if there is no delegate.

getDocument

public Document getDocument()
Get the actual document object. One should normally just use the XMLObject methods to access the Document functionality, this is for the initialization of derived objects.

getMIMEType

public String getMIMEType()
Get the MIME type associated with the document, or null if none was associated.

getEncoding

public String getEncoding()
Get the encoding specified in the document. Note that this is the symbolic name of the XML encoding, which is not the same as the Java encoding names.
Returns:
the encoding or null if no encoding was explicitly specified.
See Also:
DOMFormatter, OutputOptions

setEncoding

public void setEncoding(String encoding)
See org.w3c.dom.Document#setEncoding

getStandalone

public boolean getStandalone()
See org.w3c.dom.Document#getStandalone

setStandalone

public void setStandalone(boolean standalone)
See org.w3c.dom.Document#setStandalone

getStrictErrorChecking

public boolean getStrictErrorChecking()
See org.w3c.dom.Document#getStrictErrorChecking
Specified by:
getStrictErrorChecking in interface Document

setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)
See org.w3c.dom.Document#setStrictErrorChecking
Specified by:
setStrictErrorChecking in interface Document

getVersion

public String getVersion()
See org.w3c.dom.Document#getVersion()

setVersion

public void setVersion(String version)
See org.w3c.dom.Document#setVersion

adoptNode

public Node adoptNode(Node source)
               throws DOMException
See org.w3c.dom.Document#adoptNode
Specified by:
adoptNode in interface Document

toDocument

public String toDocument()
Convert the document to a string representation of the document, that is a string containing XML. The results are parsable into the same DOM hierarchy. The formatting provided by this method does not begin to cover all of the issues involved with publishing a XML document, such as character encoding. Use the DOMFormatter class if more options are required.
Returns:
A string containing the full XML.
See Also:
DOMFormatter


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.