fi.hut.tml.xsmiles.mlfc.xforms.instance
Class BasicInstanceDocumentImpl

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.CoreDocumentImpl
                  extended byorg.apache.xerces.dom.DocumentImpl
                      extended byfi.hut.tml.xsmiles.mlfc.xforms.instance.BasicInstanceDocumentImpl
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Document, org.w3c.dom.events.DocumentEvent, org.w3c.dom.ls.DocumentLS, org.w3c.dom.ranges.DocumentRange, org.w3c.dom.traversal.DocumentTraversal, org.w3c.dom.events.EventTarget, InstanceDocument, InstanceNode, org.w3c.dom.Node, org.w3c.dom.NodeList, java.io.Serializable

public class BasicInstanceDocumentImpl
extends org.apache.xerces.dom.DocumentImpl
implements InstanceNode, InstanceDocument

See Also:
Serialized Form

Field Summary
protected  java.util.Vector errors
          forces revalidation of the whole doc (uses normalizeDocument) this is called in insert / delete / submit DOM node addition & deletion
static java.lang.String GRAMMAR_POOL
          Property identifier: grammar pool.
protected  InstanceElement instanceElement
          my instance element in the UI DOM
protected  SchemaPool schemaPool
           
protected  boolean submissionOn
           
static java.lang.String SYMBOL_TABLE
          Property identifier: symbol table.
 
Fields inherited from class org.apache.xerces.dom.DocumentImpl
eventListeners, iterators, mutationEvents, ranges
 
Fields inherited from class org.apache.xerces.dom.CoreDocumentImpl
actualEncoding, allowGrammarAccess, changes, docElement, docType, encoding, errorChecking, fDocumentURI, identifiers, standalone, userData, version
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.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, 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, 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
BasicInstanceDocumentImpl()
           
 
Method Summary
 org.w3c.dom.Node cloneNode(boolean deep)
          Deep-clone a document, including fixing ownerDoc for the cloned children.
protected  void cloneNode(org.apache.xerces.dom.DocumentImpl newdoc)
          internal method
 org.w3c.dom.Attr createAttribute(java.lang.String name)
           
 org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String localName)
          Xerces-specific constructor.
 org.w3c.dom.Element createElement(java.lang.String tag)
           
 org.w3c.dom.Element createElementNS(java.lang.String ns, java.lang.String tag)
          Create a new element - this method should be the only way to create new elements.
 org.w3c.dom.Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String localpart)
          NON-DOM: Xerces-specific constructor.
 org.w3c.dom.Element getElementById(java.lang.String id)
          this is a crude hack for scripts, because XSmilesDocuments do not implement real id's
 InstanceElement getInstanceElement()
          get my UI DOM instance element (needed for replace="instance"
 InstanceItem getInstanceItem()
          get the instance item of this node
 PropertyInheriter getPropertyInheriter()
          get the property inheriter of this instance node (usually the instance item)
 SchemaPool getSchemaPool()
           
 void setInstanceElement(InstanceElement inst)
          set my UI DOM instance element (needed for replace="instance"
 void setSchemaPool(SchemaPool pool)
           
 java.lang.String toString()
           
 java.util.Vector validateDocument(boolean isSubmission)
           
 
Methods inherited from class org.apache.xerces.dom.DocumentImpl
addEventListener, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, getEventListeners, getImplementation, removeEventListener, saveEnclosingAttr, setEventListeners
 
Methods inherited from class org.apache.xerces.dom.CoreDocumentImpl
abort, adoptNode, changed, changes, checkDOMNSErr, checkNamespaceWF, checkQName, clearIdentifiers, clone, cloneNode, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElementDefinition, createEntity, createEntityReference, createNotation, createProcessingInstruction, createTextNode, getActualEncoding, getAsync, getBaseURI, getConfig, getDoctype, getDocumentElement, getDocumentURI, getElementsByTagName, getElementsByTagNameNS, getEncoding, getErrorChecking, getIdentifier, getIdentifiers, getNodeName, getNodeNumber, getNodeNumber, getNodeType, getOwnerDocument, getStandalone, getStrictErrorChecking, getTextContent, getUserData, getUserData, getVersion, importNode, insertBefore, isKidOK, isXMLName, load, loadXML, normalizeDocument, putIdentifier, removeChild, removeIdentifier, renameNode, replaceChild, saveXML, setActualEncoding, setAsync, setDocumentURI, setEncoding, setErrorChecking, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setUserData, setVersion
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, hasChildNodes, isEqualNode, item, normalize, setReadOnly, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getContainer, getFeature, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, hasAttributes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setPrefix, setUserData, setUserData, synchronizeData
 
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, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface fi.hut.tml.xsmiles.mlfc.xforms.instance.InstanceDocument
setEncoding
 
Methods inherited from interface org.w3c.dom.Document
createCDATASection, createComment, createDocumentFragment, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getElementsByTagName, getElementsByTagNameNS, getImplementation, importNode
 

Field Detail

SYMBOL_TABLE

public static final java.lang.String SYMBOL_TABLE
Property identifier: symbol table.

See Also:
Constant Field Values

GRAMMAR_POOL

public static final java.lang.String GRAMMAR_POOL
Property identifier: grammar pool.

See Also:
Constant Field Values

instanceElement

protected InstanceElement instanceElement
my instance element in the UI DOM


errors

protected java.util.Vector errors
forces revalidation of the whole doc (uses normalizeDocument) this is called in insert / delete / submit DOM node addition & deletion


schemaPool

protected SchemaPool schemaPool

submissionOn

protected boolean submissionOn
Constructor Detail

BasicInstanceDocumentImpl

public BasicInstanceDocumentImpl()
Method Detail

createElement

public org.w3c.dom.Element createElement(java.lang.String tag)
                                  throws org.w3c.dom.DOMException
Specified by:
createElement in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

getElementById

public org.w3c.dom.Element getElementById(java.lang.String id)
this is a crude hack for scripts, because XSmilesDocuments do not implement real id's

Specified by:
getElementById in interface org.w3c.dom.Document

createElementNS

public org.w3c.dom.Element createElementNS(java.lang.String ns,
                                           java.lang.String tag)
                                    throws org.w3c.dom.DOMException
Create a new element - this method should be the only way to create new elements. To copy an element, call this and then copy the attributes.

Specified by:
createElementNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

toString

public java.lang.String toString()

createAttributeNS

public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI,
                                          java.lang.String qualifiedName)
                                   throws org.w3c.dom.DOMException
Specified by:
createAttributeNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createAttribute

public org.w3c.dom.Attr createAttribute(java.lang.String name)
                                 throws org.w3c.dom.DOMException
Specified by:
createAttribute in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

setSchemaPool

public void setSchemaPool(SchemaPool pool)
Specified by:
setSchemaPool in interface InstanceDocument

getSchemaPool

public SchemaPool getSchemaPool()
Specified by:
getSchemaPool in interface InstanceDocument

validateDocument

public java.util.Vector validateDocument(boolean isSubmission)
Specified by:
validateDocument in interface InstanceDocument

createElementNS

public org.w3c.dom.Element createElementNS(java.lang.String namespaceURI,
                                           java.lang.String qualifiedName,
                                           java.lang.String localpart)
                                    throws org.w3c.dom.DOMException
NON-DOM: Xerces-specific constructor. "localName" is passed in, so we don't need to create a new String for it.

Parameters:
namespaceURI - The namespace URI of the element to create.
qualifiedName - The qualified name of the element type to instantiate.
Returns:
Element A new Element object with the following attributes:
Throws:
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createAttributeNS

public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI,
                                          java.lang.String qualifiedName,
                                          java.lang.String localName)
                                   throws org.w3c.dom.DOMException
Xerces-specific constructor. "localName" is passed in, so we don't need to create a new String for it.

Parameters:
namespaceURI - The namespace URI of the attribute to create. When it is null or an empty string, this method behaves like createAttribute.
qualifiedName - The qualified name of the attribute to instantiate.
localName - The local name of the attribute to instantiate.
Returns:
Attr A new Attr object.
Throws:
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)
Deep-clone a document, including fixing ownerDoc for the cloned children. Note that this requires bypassing the WRONG_DOCUMENT_ERR protection. I've chosen to implement it by calling importNode which is DOM Level 2.

Specified by:
cloneNode in interface org.w3c.dom.Node
Parameters:
deep - boolean, iff true replicate children
Returns:
org.w3c.dom.Node

cloneNode

protected void cloneNode(org.apache.xerces.dom.DocumentImpl newdoc)
internal method


getInstanceItem

public InstanceItem getInstanceItem()
get the instance item of this node

Specified by:
getInstanceItem in interface InstanceNode

getPropertyInheriter

public PropertyInheriter getPropertyInheriter()
Description copied from interface: InstanceNode
get the property inheriter of this instance node (usually the instance item)

Specified by:
getPropertyInheriter in interface InstanceNode

setInstanceElement

public void setInstanceElement(InstanceElement inst)
set my UI DOM instance element (needed for replace="instance"

Specified by:
setInstanceElement in interface InstanceDocument

getInstanceElement

public InstanceElement getInstanceElement()
get my UI DOM instance element (needed for replace="instance"

Specified by:
getInstanceElement in interface InstanceDocument


X-Smiles 1.2