org.gxml.sa
Interface GxModel<N,A,S,T>

All Superinterfaces:
java.util.Comparator<N>, Model<N,S,SmName<S>>

public interface GxModel<N,A,S,T>
extends java.util.Comparator<N>, Model<N,S,SmName<S>>

Aspect of the data model interface providing read-only access to the XQuery Data Model tree.


Method Summary
 int compare(N one, N two)
          Determines the relative document order of two nodes.
 java.lang.Iterable<N> getAncestorAxis(N origin)
          Returns the nodes along the ancestor axis using the specified node as the origin.
 java.lang.Iterable<N> getAncestorOrSelfAxis(N origin)
          Returns the nodes along the ancestor-or-self axis using the specified node as the origin.
 A getAtom(N node, int index)
          Returns the atom at a specified index consistent with getTypedValue(N).
 int getAtomCount(N node)
          Returns the number of atoms in the node consistent with getTypedValue(N) .
 N getAttribute(N parent, S namespaceURI, S localName)
          Returns the attribute node with the specified expanded-QName.
 java.lang.Iterable<N> getAttributeAxis(N origin, boolean inherit)
          Returns the nodes along the attribute axis using the specified node as the origin.
 java.net.URI getBaseURI(N node)
          Returns the base-uri property of the node.
 java.lang.Iterable<N> getChildAxis(N origin)
          Returns the nodes along the child axis using the specified node as the origin.
 java.lang.Iterable<N> getChildElements(N origin)
          Returns all the child element along the child axis.
 java.lang.Iterable<N> getChildElementsByName(N origin, S namespaceURI, S localName)
          Returns all the child element along the child axis whose names match the arguments supplied.
 java.lang.Iterable<N> getDescendantAxis(N origin)
          Returns the nodes along the descendant axis using the specified node as the origin.
 java.lang.Iterable<N> getDescendantOrSelfAxis(N origin)
          Returns the nodes along the descendant-or-self axis using the specified node as the origin.
 java.net.URI getDocumentURI(N node)
          Returns the absolute URI of the resource from which the Document Node was constructed.
 N getFirstChild(N origin)
          Returns the first child node of the node provided.
 N getFirstChildElement(N origin)
          Returns the first child element along the child axis.
 N getFirstChildElementByName(N origin, S namespaceURI, S localName)
          Returns the first child element along the child axis whose name matches the arguments supplied.
 java.lang.Iterable<N> getFollowingAxis(N origin)
          Returns the nodes along the following axis using the specified node as the origin.
 java.lang.Iterable<N> getFollowingSiblingAxis(N origin)
          Returns the nodes along the following-sibling axis using the specified node as the origin.
 N getLastChild(N origin)
          Returns the last child node of the node provided.
 int getLineNumber(N node)
          Returns the line number, or -1 if none is available.
 S getLocalName(N node)
          Returns the local-name part of the node name.
 java.lang.String getLocalNameAsString(N node)
          Returns the local-name part of the node name as a String.
 GxNameBridge<S> getNameBridge()
          Returns the name bridge associated with this model.
 java.lang.Iterable<N> getNamespaceAxis(N node, boolean inherit)
          Returns the nodes along the namespace axis using the specified node as the origin.
 java.lang.Iterable<GxNamespaceBinding<S>> getNamespaceBindings(N node)
          Returns the namespace bindings associated with the node as a set or prefix/URI pairs.
 S getNamespaceURI(N node)
          Returns the namespace-uri part of the node name.
 java.lang.String getNamespaceURIAsString(N node)
          Returns the namespace-uri part of the node name as a String.
 N getNextSibling(N origin)
          Returns the next sibling node of the node provided.
 N getNextSiblingElement(N node)
          Returns the next element along the child axis.
 N getNextSiblingElementByName(N node, S namespaceURI, S localName)
          Returns the next element along the following-sibling axis whose name matches the arguments supplied.
 NodeKind getNodeKind(N node)
          Returns the node-kind of the node as an enumerated type in NodeKind.
 N getParent(N origin)
          Returns the parent node of the node provided.
 java.lang.Iterable<N> getPrecedingAxis(N origin)
          Returns the nodes along the preceding axis using the specified node as the origin.
 java.lang.Iterable<N> getPrecedingSiblingAxis(N origin)
          Returns the nodes along the preceding-sibling axis using the specified node as the origin.
 java.lang.String getPrefix(N node)
          Returns the prefix part of the node name.
 N getPreviousSibling(N origin)
          Returns the previous sibling node of the node provided.
 N getRoot(N node)
          Returns the identity of the top-most node along the ancestor-or-self axis from this node.
 java.lang.String getStringValue(N node)
          Returns the dm:string-value property of the node.
 S getSymbolValue(N node)
          Equivalent to getStringValue(N) followed by symbolize.
 java.util.List<A> getTypedValue(N node)
          Returns the dm:typed-value property of the node paying attention to the emulation mode in cases where it is neccessary to serialize a typed-value to a string-value.
 SmName<S> getTypeName(N node)
          Gets the type name of an element or attribute node.
 boolean hasAttributes(N node)
          Determines whether there are attribute nodes on the attribute axis for this node.
 boolean hasChildren(N node)
          Determines whether there are nodes on the child axis for this node.
 boolean hasNamespaces(N node)
          Determines whether prefix to namespace mappings exist for this node.
 boolean hasNextSibling(N node)
          Determines whether there are nodes on the following-sibling axis for this node.
 boolean hasParent(N node)
          Determines whether there are nodes on the parent axis for this node.
 boolean hasPreviousSibling(N node)
          Determines whether there are nodes on the preceding-sibling axis for this node.
 java.lang.Boolean isID(N node)
          Returns true if the node is an XML ID.
 java.lang.Boolean isIDREFS(N node)
          Returns true if the node is an XML IDREF or IDREFS.
 boolean isSameNode(N one, N two)
          Determines whether the two nodes represent the same nodes based upon identity.
 boolean matches(N node, NodeKind kind, S namespace, S localName)
          Determines whether the specified node matches in kind and name.
 java.lang.Boolean nilled(N node)
          Returns true if the node is "nilled".
 N[] nodeArray(int size)
          Allocates an empty array of nodes.
 void stream(N node, boolean copyNamespaces, boolean copyTypeAnnotations, GxContentHandler<A,S,T> handler)
          Support for streaming a node to a GxContentHandler.
 java.lang.String unparsedEntityPublicId(N node, java.lang.String entityName)
          Returns the public identifier of an unparsed external entity declared in the specified document.
 java.lang.String unparsedEntitySystemId(N node, java.lang.String entityName)
          Returns the system identifier of an unparsed external entity declared in the specified document.
 
Methods inherited from interface org.gxml.xdm.Model
getAttributeNames
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

compare

int compare(N one,
            N two)
Determines the relative document order of two nodes.

Specified by:
compare in interface java.util.Comparator<N>
Parameters:
one - The first node used in the comparison.
two - The second node in the comparison.

getAncestorAxis

java.lang.Iterable<N> getAncestorAxis(N origin)
Returns the nodes along the ancestor axis using the specified node as the origin.

Specified by:
getAncestorAxis in interface Model<N,S,SmName<S>>
Parameters:
origin - The origin node.

getAncestorOrSelfAxis

java.lang.Iterable<N> getAncestorOrSelfAxis(N origin)
Returns the nodes along the ancestor-or-self axis using the specified node as the origin.

Specified by:
getAncestorOrSelfAxis in interface Model<N,S,SmName<S>>
Parameters:
origin - The origin node.

getAtom

A getAtom(N node,
          int index)
Returns the atom at a specified index consistent with getTypedValue(N).

Parameters:
node - The node for which the atom is required.
index - The zero-based index of the atom.

getAtomCount

int getAtomCount(N node)
Returns the number of atoms in the node consistent with getTypedValue(N) .

Parameters:
node - The node for which the number of atoms are required.

getAttribute

N getAttribute(N parent,
               S namespaceURI,
               S localName)
Returns the attribute node with the specified expanded-QName.

Specified by:
getAttribute in interface Model<N,S,SmName<S>>
Parameters:
parent - The node that is the parent of the attribute node.
namespaceURI - The namespace-uri part of the attribute name.
localName - The local-name part of the attribute name.

getAttributeAxis

java.lang.Iterable<N> getAttributeAxis(N origin,
                                       boolean inherit)
Returns the nodes along the attribute axis using the specified node as the origin.
Corresponds to the dm:attributes accessor in the XDM.

Parameters:
origin - The origin node.
inherit - Determines whether attribultes in the XML namespace will be inherited. The standard value for this parameter is false.

getBaseURI

java.net.URI getBaseURI(N node)
                        throws java.net.URISyntaxException
Returns the base-uri property of the node.
Corresponds to the dm:base-uri accessor in the XDM.

Throws:
java.net.URISyntaxException

getChildAxis

java.lang.Iterable<N> getChildAxis(N origin)
Returns the nodes along the child axis using the specified node as the origin.
Corresponds to the dm:children accessor in the XDM.

Specified by:
getChildAxis in interface Model<N,S,SmName<S>>
Parameters:
origin - The origin node.

getChildElements

java.lang.Iterable<N> getChildElements(N origin)
Returns all the child element along the child axis.

Parameters:
origin - The parent node that owns the child axis.

getChildElementsByName

java.lang.Iterable<N> getChildElementsByName(N origin,
                                             S namespaceURI,
                                             S localName)
Returns all the child element along the child axis whose names match the arguments supplied.

Parameters:
origin - The parent node that owns the child axis.
namespaceURI - The namespace-uri to be matched.
localName - The local-name to be matched.

getDescendantAxis

java.lang.Iterable<N> getDescendantAxis(N origin)
Returns the nodes along the descendant axis using the specified node as the origin.

Parameters:
origin - The origin node.

getDescendantOrSelfAxis

java.lang.Iterable<N> getDescendantOrSelfAxis(N origin)
Returns the nodes along the descendant-or-self axis using the specified node as the origin.

Parameters:
origin - The origin node.

getDocumentURI

java.net.URI getDocumentURI(N node)
Returns the absolute URI of the resource from which the Document Node was constructed.
Corresponds to the dm:document-uri accessor in the XDM.


getFirstChild

N getFirstChild(N origin)
Returns the first child node of the node provided.

Parameters:
origin - The node for which the first child node is required.

getFirstChildElement

N getFirstChildElement(N origin)
Returns the first child element along the child axis.

Parameters:
origin - The parent node that owns the child axis.

getFirstChildElementByName

N getFirstChildElementByName(N origin,
                             S namespaceURI,
                             S localName)
Returns the first child element along the child axis whose name matches the arguments supplied.

Parameters:
origin - The parent node that owns the child axis.
namespaceURI - The namespace-uri to be matched.
localName - The local-name to be matched.

getFollowingAxis

java.lang.Iterable<N> getFollowingAxis(N origin)
Returns the nodes along the following axis using the specified node as the origin.

Parameters:
origin - The origin node.

getFollowingSiblingAxis

java.lang.Iterable<N> getFollowingSiblingAxis(N origin)
Returns the nodes along the following-sibling axis using the specified node as the origin.

Parameters:
origin - The origin node.

getLastChild

N getLastChild(N origin)
Returns the last child node of the node provided.

Parameters:
origin - The node for which the last child node is required.

getLineNumber

int getLineNumber(N node)
Returns the line number, or -1 if none is available.


getLocalName

S getLocalName(N node)
Returns the local-name part of the node name.

Specified by:
getLocalName in interface Model<N,S,SmName<S>>
Parameters:
node - The node for which the node local-name is required.

getLocalNameAsString

java.lang.String getLocalNameAsString(N node)
Returns the local-name part of the node name as a String.
Provided to optimize access for namespace and processing-instruction nodes.

Parameters:
node - The node for which the node local-name is required.

getNameBridge

GxNameBridge<S> getNameBridge()
Returns the name bridge associated with this model.


getNamespaceAxis

java.lang.Iterable<N> getNamespaceAxis(N node,
                                       boolean inherit)
Returns the nodes along the namespace axis using the specified node as the origin.
Corresponds to the dm:namespaces accessor in the XDM.

Parameters:
node - The origin node.
inherit - Determines whether in-scope prefix mappings will be included in the result. The standard setting for this parameter is true.

getNamespaceBindings

java.lang.Iterable<GxNamespaceBinding<S>> getNamespaceBindings(N node)
Returns the namespace bindings associated with the node as a set or prefix/URI pairs.

Parameters:
node - The node under consideration.

getNamespaceURI

S getNamespaceURI(N node)
Returns the namespace-uri part of the node name.

Specified by:
getNamespaceURI in interface Model<N,S,SmName<S>>
Parameters:
node - The node for which the node namespace-uri is required.

getNamespaceURIAsString

java.lang.String getNamespaceURIAsString(N node)
Returns the namespace-uri part of the node name as a String.
Provided to optimize access.

Parameters:
node - The node for which the node local-name is required.

getNextSibling

N getNextSibling(N origin)
Returns the next sibling node of the node provided.

Parameters:
origin - The node for which the next sibling node is required.

getNextSiblingElement

N getNextSiblingElement(N node)
Returns the next element along the child axis.

Parameters:
node - The node for which the next sibling node is required.

getNextSiblingElementByName

N getNextSiblingElementByName(N node,
                              S namespaceURI,
                              S localName)
Returns the next element along the following-sibling axis whose name matches the arguments supplied.

Parameters:
node - The node for which the next sibling node is required.
namespaceURI - The namespace-uri to be matched.
localName - The local-name to be matched.

getNodeKind

NodeKind getNodeKind(N node)
Returns the node-kind of the node as an enumerated type in NodeKind.
Applies to all node kinds and never returns null.
Corresponds to the dm:node-kind accessor in the XDM.

Specified by:
getNodeKind in interface Model<N,S,SmName<S>>
Parameters:
node - The node for which the node-kind is required.

getParent

N getParent(N origin)
Returns the parent node of the node provided.
May return null for top-most or orphaned nodes.
Corresponds to the dm:parent accessor in the XDM.

Specified by:
getParent in interface Model<N,S,SmName<S>>
Parameters:
origin - The node for which the parent is required.

getPrecedingAxis

java.lang.Iterable<N> getPrecedingAxis(N origin)
Returns the nodes along the preceding axis using the specified node as the origin.

Parameters:
origin - The origin node.

getPrecedingSiblingAxis

java.lang.Iterable<N> getPrecedingSiblingAxis(N origin)
Returns the nodes along the preceding-sibling axis using the specified node as the origin.

Parameters:
origin - The origin node.

getPrefix

java.lang.String getPrefix(N node)
Returns the prefix part of the node name.
This is just a hint because it usually contains the prefix of the original document. The prefix will not be updated to reflect in scope namespaces.

Parameters:
node - The node for which the prefix-hint is required.

getPreviousSibling

N getPreviousSibling(N origin)
Returns the previous sibling node of the node provided.

Parameters:
origin - The node for which the previous sibling node is required.

getRoot

N getRoot(N node)
Returns the identity of the top-most node along the ancestor-or-self axis from this node.

Parameters:
node - The node from which to begin the search for the top-most node.

getStringValue

java.lang.String getStringValue(N node)
Returns the dm:string-value property of the node. Applies to all node kinds.

Specified by:
getStringValue in interface Model<N,S,SmName<S>>
Parameters:
node - The node for which the dm:string-value is required.

getSymbolValue

S getSymbolValue(N node)
Equivalent to getStringValue(N) followed by symbolize.


getTypeName

SmName<S> getTypeName(N node)
Gets the type name of an element or attribute node.
Returns null for all other node kinds.
Corresponds to the dm:type-name accessor in the XDM.

Parameters:
node - The node for which the type name is required.

getTypedValue

java.util.List<A> getTypedValue(N node)
Returns the dm:typed-value property of the node paying attention to the emulation mode in cases where it is neccessary to serialize a typed-value to a string-value. Applies to all node kinds.

Parameters:
node - The node for which dm:typed-value is required.

hasAttributes

boolean hasAttributes(N node)
Determines whether there are attribute nodes on the attribute axis for this node.

Parameters:
node - The node under consideration.

hasChildren

boolean hasChildren(N node)
Determines whether there are nodes on the child axis for this node.

Parameters:
node - The node under consideration.

hasNamespaces

boolean hasNamespaces(N node)
Determines whether prefix to namespace mappings exist for this node.

Parameters:
node - The node under consideration.

hasNextSibling

boolean hasNextSibling(N node)
Determines whether there are nodes on the following-sibling axis for this node.

Parameters:
node - The node under consideration.

hasParent

boolean hasParent(N node)
Determines whether there are nodes on the parent axis for this node.

Parameters:
node - The node under consideration.

hasPreviousSibling

boolean hasPreviousSibling(N node)
Determines whether there are nodes on the preceding-sibling axis for this node.

Parameters:
node - The node under consideration.

isID

java.lang.Boolean isID(N node)
Returns true if the node is an XML ID.
Corresponds to the dm:is-id accessor in XDM.

Parameters:
node - The node for which the dm:is-id accessor is required.

isIDREFS

java.lang.Boolean isIDREFS(N node)
Returns true if the node is an XML IDREF or IDREFS.
Corresponds to the dm:is-idrefs accessor in XDM.

Parameters:
node - The node for which the dm:is-idrefs accessor is required.

isSameNode

boolean isSameNode(N one,
                   N two)
Determines whether the two nodes represent the same nodes based upon identity.

Parameters:
one - The first node used in the comparison.
two - The second node in the comparison.

matches

boolean matches(N node,
                NodeKind kind,
                S namespace,
                S localName)
Determines whether the specified node matches in kind and name.

Parameters:
node - The node being tested.
kind - The nodekind specification.
namespace - The namespace part of the name.
localName - The local-name part of the name.
Returns:
true if the node matches the arguments specified, otherwise false.

nilled

java.lang.Boolean nilled(N node)
Returns true if the node is "nilled".
Corresponds to the dm:nilled accessor in XDM.

Parameters:
node - The node for which the dm:nilled accessor is required.

nodeArray

N[] nodeArray(int size)
Allocates an empty array of nodes.

Parameters:
size - The size of the array of nodes.

stream

void stream(N node,
            boolean copyNamespaces,
            boolean copyTypeAnnotations,
            GxContentHandler<A,S,T> handler)
            throws GxException
Support for streaming a node to a GxContentHandler.

Parameters:
node - The node to be streamed.
copyNamespaces - Determines whether namespaces nodes are streamed.
copyTypeAnnotations - Determines whether type annotations are streamed.
handler - The handler for events generated.
Throws:
GxException

unparsedEntityPublicId

java.lang.String unparsedEntityPublicId(N node,
                                        java.lang.String entityName)
Returns the public identifier of an unparsed external entity declared in the specified document.
Corresponds to the dm:unparsed-entity-public-id accessor in XDM.

Parameters:
node - The node for which the dm:unparsed-entity-public-id accessor is required.
entityName - The entity name.

unparsedEntitySystemId

java.lang.String unparsedEntitySystemId(N node,
                                        java.lang.String entityName)
Returns the system identifier of an unparsed external entity declared in the specified document.
Corresponds to the dm:unparsed-entity-system-id accessor in XDM.

Parameters:
node - The node for which the dm:unparsed-entity-system-id accessor is required.
entityName - The entity name.


Copyright © 2009 TIBCO Software Inc. All Rights Reserved.