com.teamkonzept.dom4jb.saxon
Class Document

java.lang.Object
  |
  +--com.teamkonzept.dom4jb.dom.NodeList
        |
        +--com.teamkonzept.dom4jb.dom.Node
              |
              +--com.teamkonzept.dom4jb.dom.Document
                    |
                    +--com.teamkonzept.dom4jb.saxon.Document
All Implemented Interfaces:
AxisNode, Document, com.icl.saxon.om.DocumentInfo, Node, com.icl.saxon.om.NodeInfo, NodeList, Source

public class Document
extends Document
implements com.icl.saxon.om.DocumentInfo, AxisNode


Nested Class Summary
 
Nested classes inherited from class com.teamkonzept.dom4jb.dom.Document
Document.NodeList
 
Field Summary
protected  String baseURI
           
protected  Hashtable keyTable
           
protected  com.icl.saxon.om.NamePool namePool
           
 
Fields inherited from class com.teamkonzept.dom4jb.dom.Node
document
 
Fields inherited from class com.teamkonzept.dom4jb.dom.NodeList
EMPTY, initialCapacity, nodeData, nodeIterator, parent, size
 
Fields inherited from interface com.icl.saxon.om.NodeInfo
ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, ROOT, TEXT
 
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
Document(String baseURI)
           
 
Method Summary
 void attachAxis(int position, DescendantAxis axis)
           
 int compareOrder(com.icl.saxon.om.NodeInfo other)
          Determine the relative position of this node and another node, in document order.
 void copy(com.icl.saxon.output.Outputter out)
          Copy this node to a given outputter (deep copy)
 void copyStringValue(com.icl.saxon.output.Outputter out)
          Copy the string-value of this node to a given outputter
 Attribute createAttribute(AttributeDescriptor descriptor, Object bean)
           
 Element createElement(ElementDescriptor descriptor, Object bean)
           
 Element createElement(String name, Object bean)
           
 Text createText(TextDescriptor descriptor, Object bean)
           
 void expandStringValue(StringBuffer sb)
           
 String generateId()
          Get a character string that uniquely identifies this node.
 String getAttributeValue(int fingerprint)
          Get the value of a given attribute of this node
 String getAttributeValue(String uri, String localName)
          Find the value of a given attribute of this node.
 DescendantAxis getAxis()
           
 String getBaseURI()
          Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node.
 String getDisplayName()
          Get the display name of this node.
 com.icl.saxon.om.DocumentInfo getDocumentRoot()
          Get the root (document) node
 com.icl.saxon.om.AxisEnumeration getEnumeration(byte axisNumber, com.icl.saxon.pattern.NodeTest nodeTest)
          Return an enumeration over the nodes reached by the given axis from this node The value NodeInfo.NODE means include any type of node.
 int getFingerprint()
          Get fingerprint.
 Hashtable getKeyIndex(com.icl.saxon.KeyManager keyManager, int fingerprint)
          Get the index for a given key
 int getLineNumber()
          Get line number
 int getNameCode()
          Get name code.
 com.icl.saxon.om.NamePool getNamePool()
          Get the name pool used for the names in this document
 Namespace[] getNamespaces()
           
 com.icl.saxon.om.NodeInfo getParent()
          Get the NodeInfo object representing the parent of this node
 int getPosition()
           
 String getStringValue()
          Return the string value of the node.
 String getSystemId()
           
 String getUnparsedEntity(String name)
          Get the unparsed entity with a given name
 String getURI()
          Get the URI part of the name of this node.
 boolean isSameNode(com.icl.saxon.om.NodeInfo other)
          Determine whether this is the same node as another node.
 void outputNamespaceNodes(com.icl.saxon.output.Outputter out, boolean includeAncestors)
          Output all namespace nodes associated with this element.
 com.icl.saxon.om.NodeInfo selectID(String id)
          Get the element with a given ID, if any
 void setKeyIndex(com.icl.saxon.KeyManager keyManager, int fingerprint, Hashtable index)
          Set the index for a given key
 void setNamePool(com.icl.saxon.om.NamePool pool)
          Set the name pool used for all names in this document
 void setSystemId(String systemId)
          Set the system identifier for this Source.
 
Methods inherited from class com.teamkonzept.dom4jb.dom.Document
accept, adoptNode, appendChild, createAttribute, createAttributeNS, createCDATASection, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getChildNodes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getFirstChild, getImplementation, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getParentNode, getPrefix, getPreviousSibling, getStandalone, getStrictErrorChecking, getVersion, hasChildNodes, importNode, setEncoding, setPrefix, setStandalone, setStrictErrorChecking, setVersion
 
Methods inherited from class com.teamkonzept.dom4jb.dom.Node
attach, cloneNode, getAttributes, getChildIndex, getNodeValue, getOwnerDocument, hasAttributes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue
 
Methods inherited from class com.teamkonzept.dom4jb.dom.NodeList
add, clear, ensureCapacity, get, getLength, isEmpty, item, setIterator, setParentNode, size, trimToSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.icl.saxon.om.NodeInfo
getLocalName, getNodeType, getPrefix, hasChildNodes
 
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
 

Field Detail

baseURI

protected String baseURI

namePool

protected com.icl.saxon.om.NamePool namePool

keyTable

protected Hashtable keyTable
Constructor Detail

Document

public Document(String baseURI)
Method Detail

createElement

public Element createElement(ElementDescriptor descriptor,
                             Object bean)
Overrides:
createElement in class Document

createElement

public Element createElement(String name,
                             Object bean)
Overrides:
createElement in class Document

createAttribute

public Attribute createAttribute(AttributeDescriptor descriptor,
                                 Object bean)
Overrides:
createAttribute in class Document

createText

public Text createText(TextDescriptor descriptor,
                       Object bean)
Overrides:
createText in class Document

attachAxis

public void attachAxis(int position,
                       DescendantAxis axis)
Specified by:
attachAxis in interface AxisNode

getAxis

public DescendantAxis getAxis()
Specified by:
getAxis in interface AxisNode

getPosition

public int getPosition()
Specified by:
getPosition in interface AxisNode

getStringValue

public String getStringValue()
Return the string value of the node. The interpretation of this depends on the type of node. For an element it is the accumulated character content of the element, including descendant elements.

Specified by:
getStringValue in interface com.icl.saxon.om.NodeInfo
Returns:
the string value of the node

getDisplayName

public String getDisplayName()
Get the display name of this node. For elements and attributes this is [prefix:]localname. For unnamed nodes, it is an empty string.

Specified by:
getDisplayName in interface com.icl.saxon.om.NodeInfo
Returns:
The display name of this node. For a node with no name, return an empty string.

getAttributeValue

public String getAttributeValue(String uri,
                                String localName)
Find the value of a given attribute of this node.
This method is defined on all nodes to meet XSL requirements, but for nodes other than elements it will always return null.

Specified by:
getAttributeValue in interface com.icl.saxon.om.NodeInfo
Parameters:
uri - the namespace uri of an attribute ("" if no namespace)
Returns:
the value of the attribute, if it exists, otherwise null

getAttributeValue

public String getAttributeValue(int fingerprint)
Get the value of a given attribute of this node

Specified by:
getAttributeValue in interface com.icl.saxon.om.NodeInfo
Parameters:
fingerprint - The fingerprint of the attribute name
Returns:
the attribute value if it exists or null if not

generateId

public String generateId()
Get a character string that uniquely identifies this node.
Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)

Specified by:
generateId in interface com.icl.saxon.om.NodeInfo
Returns:
a string that uniquely identifies this node, within this document. The calling code prepends information to make the result unique across all documents.

copy

public void copy(com.icl.saxon.output.Outputter out)
          throws TransformerException
Copy this node to a given outputter (deep copy)

Specified by:
copy in interface com.icl.saxon.om.NodeInfo
TransformerException

outputNamespaceNodes

public void outputNamespaceNodes(com.icl.saxon.output.Outputter out,
                                 boolean includeAncestors)
                          throws TransformerException
Output all namespace nodes associated with this element. Does nothing if the node is not an element.

Specified by:
outputNamespaceNodes in interface com.icl.saxon.om.NodeInfo
Parameters:
out - The relevant outputter
includeAncestors - True if namespaces declared on ancestor elements must be output; false if it is known that these are already on the result tree
TransformerException

expandStringValue

public void expandStringValue(StringBuffer sb)
Specified by:
expandStringValue in interface AxisNode

getNamespaces

public Namespace[] getNamespaces()
Specified by:
getNamespaces in interface AxisNode

setNamePool

public void setNamePool(com.icl.saxon.om.NamePool pool)
Set the name pool used for all names in this document

Specified by:
setNamePool in interface com.icl.saxon.om.DocumentInfo

getNamePool

public com.icl.saxon.om.NamePool getNamePool()
Get the name pool used for the names in this document

Specified by:
getNamePool in interface com.icl.saxon.om.DocumentInfo

getSystemId

public String getSystemId()
Specified by:
getSystemId in interface com.icl.saxon.om.NodeInfo

setSystemId

public void setSystemId(String systemId)
Set the system identifier for this Source.

The system identifier is optional if the source does not get its data from a URL, but it may still be useful to provide one. The application can use a system identifier, for example, to resolve relative URIs and to include in error messages and warnings.

Specified by:
setSystemId in interface Source
Parameters:
systemId - The system identifier as a URL string.

selectID

public com.icl.saxon.om.NodeInfo selectID(String id)
Get the element with a given ID, if any

Specified by:
selectID in interface com.icl.saxon.om.DocumentInfo
Parameters:
id - the required ID value
Returns:
null: not yet implemented

getKeyIndex

public Hashtable getKeyIndex(com.icl.saxon.KeyManager keyManager,
                             int fingerprint)
Get the index for a given key

Specified by:
getKeyIndex in interface com.icl.saxon.om.DocumentInfo
Parameters:
keyManager - The key manager managing this key
fingerprint - The fingerprint of the name of the key (unique with the key manager)
Returns:
The index, if one has been built, in the form of a Hashtable that maps the key value to a list of nodes having that key value. If no index has been built, returns null.

setKeyIndex

public void setKeyIndex(com.icl.saxon.KeyManager keyManager,
                        int fingerprint,
                        Hashtable index)
Set the index for a given key

Specified by:
setKeyIndex in interface com.icl.saxon.om.DocumentInfo
Parameters:
keyManager - The key manager managing this key
fingerprint - The fingerprint of the name of the key (unique with the key manager)
index - the index, in the form of a Hashtable that maps the key value to a list of nodes having that key value

getUnparsedEntity

public String getUnparsedEntity(String name)
Get the unparsed entity with a given name

Specified by:
getUnparsedEntity in interface com.icl.saxon.om.DocumentInfo
Parameters:
name - the name of the entity
Returns:
null: not yet implemented

getBaseURI

public String getBaseURI()
Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node. This will be the same as the System ID unless xml:base has been used.

Specified by:
getBaseURI in interface com.icl.saxon.om.NodeInfo

getLineNumber

public int getLineNumber()
Get line number

Specified by:
getLineNumber in interface com.icl.saxon.om.NodeInfo
Returns:
the line number of the node in its original source document; or -1 if not available

getNameCode

public int getNameCode()
Get name code. The name code is a coded form of the node name: two nodes with the same name code have the same namespace URI, the same local name, and the same prefix. By masking the name code with &0xfffff, you get a fingerprint: two nodes with the same fingerprint have the same local name and namespace URI.

Specified by:
getNameCode in interface com.icl.saxon.om.NodeInfo
See Also:
allocate

getFingerprint

public int getFingerprint()
Get fingerprint. The fingerprint is a coded form of the expanded name of the node: two nodes with the same name code have the same namespace URI and the same local name. A fingerprint of -1 should be returned for a node with no name.

Specified by:
getFingerprint in interface com.icl.saxon.om.NodeInfo

getURI

public String getURI()
Get the URI part of the name of this node. This is the URI corresponding to the prefix, or the URI of the default namespace if appropriate.

Specified by:
getURI in interface com.icl.saxon.om.NodeInfo
Returns:
The URI of the namespace of this node. For an unnamed node, return null. For a node with an empty prefix, return an empty string.

getParent

public com.icl.saxon.om.NodeInfo getParent()
Get the NodeInfo object representing the parent of this node

Specified by:
getParent in interface com.icl.saxon.om.NodeInfo

getDocumentRoot

public com.icl.saxon.om.DocumentInfo getDocumentRoot()
Get the root (document) node

Specified by:
getDocumentRoot in interface com.icl.saxon.om.NodeInfo
Returns:
the DocumentInfo representing the containing document

copyStringValue

public void copyStringValue(com.icl.saxon.output.Outputter out)
                     throws TransformerException
Copy the string-value of this node to a given outputter

Specified by:
copyStringValue in interface com.icl.saxon.om.NodeInfo
TransformerException

getEnumeration

public com.icl.saxon.om.AxisEnumeration getEnumeration(byte axisNumber,
                                                       com.icl.saxon.pattern.NodeTest nodeTest)
Return an enumeration over the nodes reached by the given axis from this node The value NodeInfo.NODE means include any type of node.

Specified by:
getEnumeration in interface com.icl.saxon.om.NodeInfo
Parameters:
nodeTest - A pattern to be matched by the returned nodes
Returns:
a NodeEnumeration that scans the nodes reached by the axis in turn.

compareOrder

public int compareOrder(com.icl.saxon.om.NodeInfo other)
Determine the relative position of this node and another node, in document order. The other node will always be in the same document.

Specified by:
compareOrder in interface com.icl.saxon.om.NodeInfo
Parameters:
other - The other node, whose position is to be compared with this node
Returns:
-1 if this node precedes the other node, +1 if it follows the other node, or 0 if they are the same node. (In this case, isSameNode() will always return true, and the two nodes will produce the same result for generateId())

isSameNode

public boolean isSameNode(com.icl.saxon.om.NodeInfo other)
Determine whether this is the same node as another node.
Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)

Specified by:
isSameNode in interface com.icl.saxon.om.NodeInfo
Returns:
true if this Node object and the supplied Node object represent the same node in the tree.


Copyright © 2001-2003 Team-Konzept GmbH & CO KG. All Rights Reserved.