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

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, userData
 
Fields inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
allowGrammarAccess, changes, docElement, docType, encoding, errorChecking, identifiers, kidOK, standalone, version
 
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode
fCachedChild, fCachedChildIndex, fCachedLength, firstChild, ownerDocument
 
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl
ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, UNNORMALIZED
 
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
 
Constructor Summary
MetaDataDocument()
          Construct an empty instace of a metadata document.
 
Method Summary
 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. in a namespace.
 MetaData getMetaData()
          Get the root MetaData object, which must exist.
 File getMetadataOutputFile()
          Get the name of the metadata output file davidli: this is needed to be public for debugging/logging purpose
 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, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, getEventListeners, getImplementation, getUserData, removeEventListener, saveEnclosingAttr, setEventListeners, setUserData
 
Methods inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
adoptNode, changed, changes, clone, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElementDefinition, createEntity, createEntityReference, createNotation, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getErrorChecking, getIdentifier, getIdentifiers, getNodeName, getNodeType, getOwnerDocument, getStandalone, getStrictErrorChecking, getVersion, importNode, insertBefore, isKidOK, isXMLName, putIdentifier, removeChild, removeIdentifier, replaceChild, setEncoding, setErrorChecking, setStandalone, setStrictErrorChecking, setVersion
 
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, hasChildNodes, item, normalize, setReadOnly, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, appendChild, dispatchEvent, getAttributes, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, hasAttributes, isSupported, removeEventListener, setNodeValue, setPrefix, 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, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, isSupported, normalize, setNodeValue, setPrefix
 

Field Detail

DOC_TYPE_NAME

public static final String DOC_TYPE_NAME
Document type name

See Also:
Constant Field Values

PUBLIC_ID

public static final String PUBLIC_ID
Public id for created metadata files

See Also:
Constant Field Values

SYSTEM_ID

public static final String SYSTEM_ID
System id for created metadata files

See Also:
Constant Field Values

METADATA_FILE_EXTENSION

public static final String METADATA_FILE_EXTENSION
Extension for XMLC metadata files.

See Also:
Constant Field Values
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

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

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.

XMLCException

getMetadataOutputFile

public File getMetadataOutputFile()
Get the name of the metadata output file davidli: this is needed to be public for debugging/logging purpose


serialize

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

XMLCException

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.

Specified by:
createElement in interface Document
Overrides:
createElement in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
DOMException

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
Create a XMLC metadata document element. in a namespace.

Specified by:
createElementNS in interface Document
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.

XMLCException

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.