org.enhydra.xml.xmlc.metadata
Class MetaDataDocument

java.lang.Object
  |
  +--org.enhydra.apache.xerces.dom.NodeImpl
        |
        +--org.enhydra.apache.xerces.dom.ChildNode
              |
              +--org.enhydra.apache.xerces.dom.ParentNode
                    |
                    +--org.enhydra.apache.xerces.dom.CoreDocumentImpl
                          |
                          +--org.enhydra.apache.xerces.dom.DocumentImpl
                                |
                                +--org.enhydra.xml.xmlc.metadata.MetaDataDocument
All Implemented Interfaces:
Cloneable, Document, DocumentEvent, DocumentRange, DocumentTraversal, EventTarget, Node, NodeList, Serializable

public class MetaDataDocument
extends org.enhydra.apache.xerces.dom.DocumentImpl

Metadata XML document associated with a Document being parsed. Data maybe set from the command line or read from an XML file (or both).

See Also:
Serialized Form

Inner classes inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
org.enhydra.apache.xerces.dom.DocumentImpl.EnclosingAttr, org.enhydra.apache.xerces.dom.DocumentImpl.LEntry
 
Inner classes inherited from class org.enhydra.apache.xerces.dom.ParentNode
org.enhydra.apache.xerces.dom.ParentNode.UserDataRecord
 
Field Summary
static String DOC_TYPE_NAME
          Document type name
static String METADATA_FILE_EXTENSION
          Extension for XMLC metadata files.
static String PUBLIC_ID
          Public id for created metadata files
static String SYSTEM_ID
          System id for created metadata files
 
Fields inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
eventListeners, iterators, mutationEvents, ranges, savedEnclosingAttr, serialVersionUID
 
Fields inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
actualEncoding, allowGrammarAccess, changes, docElement, docType, domNormalizer, encoding, errorChecking, fConfiguration, fDocumentURI, fFreeNLCache, fXPathEvaluator, identifiers, standalone, userData, version, xmlVersionChanged
 
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.enhydra.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
MetaDataDocument()
          Construct an empty instace of a metadata document.
 
Method Summary
(package private) static void ()
          Static constructor.
 void completeModifications()
          Complete modifications to DOM.
 Element createElement(Class elementClass)
          Create a XMLC metadata document given its class.
 Element createElement(String tagName)
          Create a XMLC metadata document element.
 Element createElementNS(String namespaceURI, String qualifiedName)
          Create a XMLC metadata document element.
 Element createElementNS(String namespaceURI, String qualifiedName, String localpart)
           
 MetaData getMetaData()
          Get the root MetaData object, which must exist.
 File getMetadataOutputFile()
          Get the metadata output file (an empty handle to the file).
 void merge(MetaDataDocument srcDocument)
          Merge another MetaData document into this document.
static MetaDataDocument newInstance()
          Create a new, uninitialized document.
static MetaDataDocument parseMetaData(InputSource inputSource, ErrorReporter reporter, ClassLoader classLoader)
          Parse a XMLC metadata file.
 void serialize()
          Serialize this object to a XML file using the default name.
 void serialize(File file)
          Serialize this object to a XML file.
 
Methods inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
addEventListener, cloneNode, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, deletedText, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, dispatchingEventToSubtree, getEventListeners, getImplementation, getMutationEvents, insertedNode, insertedText, insertingNode, modifiedAttrValue, modifiedCharacterData, modifyingCharacterData, removedAttrNode, removedNode, removeEventListener, removeNodeIterator, removeRange, removingNode, renamedAttrNode, renamedElement, replacedCharacterData, replacedNode, replacedText, replacingData, replacingNode, saveEnclosingAttr, setAttrNode, setEventListeners, setMutationEvents, splitData
 
Methods inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
abort, adoptNode, callUserDataHandlers, callUserDataHandlers, changed, changes, checkDOMNSErr, checkNamespaceWF, checkQName, clearIdentifiers, clone, cloneNode, createAttribute, createAttributeNS, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElementDefinition, createEntity, createEntityReference, createNotation, createProcessingInstruction, createTextNode, freeNodeListCache, getAsync, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getErrorChecking, getFeature, getIdentifier, getIdentifiers, getInputEncoding, getNodeListCache, getNodeName, getNodeNumber, getNodeNumber, getNodeType, getOwnerDocument, getStandalone, getStrictErrorChecking, getTextContent, getUserData, getUserData, getUserDataRecord, getVersion, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, insertBefore, isKidOK, isNormalizeDocRequired, isValidQName, isXML11Version, isXMLName, isXMLVersionChanged, load, loadXML, normalizeDocument, putIdentifier, removeChild, removeIdentifier, removeUserDataTable, renameNode, replaceChild, saveXML, setAsync, setDocumentURI, setEncoding, setErrorChecking, setInputEncoding, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setUserData, setUserDataTable, setVersion, setXmlEncoding, setXmlStandalone, setXmlVersion, undeferChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode
checkNormalizationAfterInsert, checkNormalizationAfterRemove, getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getTextContent, hasChildNodes, hasTextContent, internalInsertBefore, internalRemoveChild, isEqualNode, item, lastChild, lastChild, normalize, ownerDocument, setOwnerDocument, setReadOnly, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling, parentNode, previousSibling
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, appendChild, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getContainer, getElementAncestor, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, hasAttributes, hasStringValue, hasStringValue, internalIsIgnorableWhitespace, isDefaultNamespace, isFirstChild, isFirstChild, isIdAttribute, isIdAttribute, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, removeEventListener, setNodeValue, setPrefix, setUserData, setUserData, synchronizeData, toString
 
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
 

Field Detail

DOC_TYPE_NAME

public static final String DOC_TYPE_NAME
Document type name

PUBLIC_ID

public static final String PUBLIC_ID
Public id for created metadata files

SYSTEM_ID

public static final String SYSTEM_ID
System id for created metadata files

METADATA_FILE_EXTENSION

public static final String METADATA_FILE_EXTENSION
Extension for XMLC metadata files.
Constructor Detail

MetaDataDocument

public MetaDataDocument()
Construct an empty instace of a metadata document. This is for use of the parse, use newInstance to create a new document.
Method Detail

static void ()
Static constructor.

parseMetaData

public static MetaDataDocument parseMetaData(InputSource inputSource,
                                             ErrorReporter reporter,
                                             ClassLoader classLoader)
                                      throws XMLCException
Parse a XMLC metadata file.
Parameters:
inputSource - Specification of file to parse.
reporter - Object use to report errors.
classLoader - If not null, class loader to use in resolving entities to be found on the classpath.

newInstance

public static MetaDataDocument newInstance()
Create a new, uninitialized document. Used when constructing a document programatically.

serialize

public void serialize(File file)
               throws XMLCException
Serialize this object to a XML file.

getMetadataOutputFile

public File getMetadataOutputFile()
Get the metadata output file (an empty handle to the file). There are three possible locations that will be tried for writing the metadata file. These locations are tried in the following order...
  1. The java class source directory, or the output directory of the XMLC class source file. Or, if it isn't defined in the metadata, ...
  2. The compile options class output root (plus the package path, if the package name is defined in the metadata). Or, if it isn't defined in the metadata, ...
  3. The current directory, or the directory from which the JVM was launched, which should be a nearly guaranteed fallback.

Note that while this is generally useful for debugging/logging purposes, it is essential for the deferred parsing feature. As such, make sure care is taken to avoid breaking functionality when overriding or reimplementing.

Returns:
an empty file handle to the metadata document, yet to be serialized

serialize

public void serialize()
               throws XMLCException
Serialize this object to a XML file using the default name.

getMetaData

public MetaData getMetaData()
Get the root MetaData object, which must exist.

createElement

public Element createElement(Class elementClass)
Create a XMLC metadata document given its class.

createElement

public Element createElement(String tagName)
                      throws DOMException
Create a XMLC metadata document element.
Overrides:
createElement in class org.enhydra.apache.xerces.dom.CoreDocumentImpl

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
                        throws DOMException
Create a XMLC metadata document element. in a namespace.
Overrides:
createElementNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName,
                               String localpart)
                        throws DOMException
Overrides:
createElementNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl

completeModifications

public void completeModifications()
                           throws XMLCException
Complete modifications to DOM. This should be called after a set of modifcations have been completed (it is called after a read). It is used to synchronize data in different areas of the DOM.

merge

public void merge(MetaDataDocument srcDocument)
Merge another MetaData document into this document.


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