Enhydra 3.0.3 API

org.enhydra.xml.xmlc
Interface XMLObject

All Known Subinterfaces:
HTMLObject
All Known Implementing Classes:
XMLObjectImpl

public interface XMLObject
extends Document

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
 void buildDocument()
          Generated method to build the DOM.
 XMLObject getDelegate()
          Get the delegate.
 Document getDocument()
          Get the actual document object.
 java.lang.String getEncoding()
          Get the encoding specified in the document.
 void setDelegate(XMLObject delegate)
          Set the delegate object.
 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, hasChildNodes, insertBefore, normalize, removeChild, replaceChild, setNodeValue, setPrefix, supports
 

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.

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.
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.

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 not encoding was explicitly specified.
See Also:
DOMFormatter, OutputOptions

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 org.enhydra.xml.io.DOMFormatter DOMFormatter class if more options are required.
Returns:
A string containing the full XML.
See Also:
DOMFormatter

Enhydra 3.0.3 API