org.enhydra.xml.xmlc
Interface XMLObject

All Superinterfaces:
org.w3c.dom.Document, DocumentInfo, org.w3c.dom.Node
All Known Subinterfaces:
HTMLObject
All Known Implementing Classes:
HTMLObjectImpl, XMLObjectImpl

public interface XMLObject
extends org.w3c.dom.Document, DocumentInfo

Interface for all compiled XML objects.


Field Summary
static java.lang.String XMLC_GENERATED_CLASS_FIELD_NAME
          The name of the class field that is used to identify an XMLC generated class.
static java.lang.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_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 org.w3c.dom.Node adoptNode(org.w3c.dom.Node source)
           
 void buildDocument()
          Generated method to build the DOM.
 XMLObject getDelegate()
          Get the delegate.
 org.w3c.dom.Document getDocument()
          Get the actual document object.
 java.lang.String getEncoding()
          Get the encoding specified in the document.
 java.lang.String getMIMEType()
          Get the MIME type associated with the document, or null if none was associated.
 boolean getStandalone()
           
 boolean getStrictErrorChecking()
           
 java.lang.String getVersion()
           
 void setDelegate(XMLObject delegate)
          Set the delegate object.
 void setEncoding(java.lang.String encoding)
           
 void setStandalone(boolean standalone)
           
 void setStrictErrorChecking(boolean strictErrorChecking)
           
 void setVersion(java.lang.String version)
           
 void syncAccessMethods()
          Initialize the fields used by the generated access methods from the current state of the document.
 java.lang.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, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, importNode
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface org.enhydra.xml.io.DocumentInfo
isURLAttribute
 

Field Detail

XMLC_GENERATED_CLASS_FIELD_NAME

public static final java.lang.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.

See Also:
Constant Field Values

XMLC_SOURCE_FILE_FIELD_NAME

public static final java.lang.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.

See Also:
Constant Field Values
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 org.w3c.dom.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 java.lang.String getMIMEType()
Get the MIME type associated with the document, or null if none was associated.


getEncoding

public java.lang.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(java.lang.String encoding)
See Also:
org.w3c.dom.Document#setEncoding

getStandalone

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

setStandalone

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

getStrictErrorChecking

public boolean getStrictErrorChecking()
See Also:
org.w3c.dom.Document#getStrictErrorChecking

setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)
See Also:
org.w3c.dom.Document#setStrictErrorChecking

getVersion

public java.lang.String getVersion()
See Also:
org.w3c.dom.Document#getVersion()

setVersion

public void setVersion(java.lang.String version)
See Also:
org.w3c.dom.Document#setVersion

adoptNode

public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source)
                           throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
See Also:
org.w3c.dom.Document#adoptNode

toDocument

public java.lang.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.