Package eu.bandm.tools.tpath.tdomclient
Class TdomClient<E extends TypedElement<E,X>,X extends TypedExtension>
java.lang.Object
eu.bandm.tools.tpath.tdomclient.TdomClient<E,X>
- All Implemented Interfaces:
DocumentClient<TdomClient.Node>
public class TdomClient<E extends TypedElement<E,X>,X extends TypedExtension>
extends Object
implements DocumentClient<TdomClient.Node>
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
(package private) class
(package private) class
(package private) class
TdomClient.Node<N extends TypedNode>
(package private) class
(package private) class
-
Field Summary
Modifier and TypeFieldDescription(package private) final int
(package private) final int
(package private) Map<URI,
TdomClient.Node> (package private) final int
protected final NodeSet<TdomClient.Node>
protected final NodeSet<TdomClient.Node>
(package private) Map<TypedDocument,
ElementDictionary<?, ?>> protected MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>>
(package private) final int
(package private) final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionattributeAxis
(TdomClient.Node node) Returns a NodeSet with all attribute nodes.childAxis
(TdomClient.Node node, boolean reverse) Returns a NodeSet with all child elements.childAxis
(TdomClient<E, X>.Element el, boolean reverse) boolean
commentTest
(TdomClient.Node node) Returns whether a node is a comment.Comparator<? super TdomClient.Node>
Returns a NodeSet with all following sibling elements.getBaseURI
(TdomClient.Node node) Returns null iff not possible to find out.getDocument
(URI uri) The xpath core library "document()" function has complicated signatures, but finally breaks down to load a document from an URI.getElementById
(TdomClient.Node node, String id) retrieves an element (or null) by the text value of the ID-type attribute.getLocalName
(TdomClient.Node node) Returns null iff node is neither Element nor Attribute; otherwise the local name.Returns null iff node is neither Element nor Attribute; otherwise the NamespaceName.Returns null iff node is neither Element nor Attribute; otherwise the URI the namespace prefix is bound to.getParent
(TdomClient.Node node) returns the parent node; null for Document.getPITarget
(TdomClient.Node node) returns the target identifier; may only be called with a PI-node!getRoot
(TdomClient.Node node) returns the owning Document.(package private) TdomClient.Node
boolean
nameTest
(TdomClient.Node node, PrincipalNodeType pnt, String uri, String suffix) uri and suffix may be ==null, which means "not tested".parentAxis
(TdomClient.Node node) Returns a NodeSet with the one direct parent.Returns a NodeSet with all preceding sibling elements.boolean
processingInstructionTest
(TdomClient.Node node, String target) Returns whether a node is PI.void
setMessageReceiver
(MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg) stringValue
(TdomClient.Node node) Never returns null, but possibly empty String [XPath 1.0:5].boolean
textTest
(TdomClient.Node node) Returns whether a node is PCDATA.
-
Field Details
-
msg
-
ELEMENT
final int ELEMENT- See Also:
-
ATTR
final int ATTR- See Also:
-
PCDATA
final int PCDATA- See Also:
-
COMMENT
final int COMMENT- See Also:
-
PI
final int PI- See Also:
-
emptyNodeSet
-
emptyNodeSetReverse
-
documentCache
Map<URI,TdomClient.Node> documentCache -
maps
Map<TypedDocument,ElementDictionary<?, maps?>>
-
-
Constructor Details
-
TdomClient
public TdomClient()
-
-
Method Details
-
setMessageReceiver
-
makeNode
-
getLocalName
Description copied from interface:DocumentClient
Returns null iff node is neither Element nor Attribute; otherwise the local name. This is the part after the colon ":" in namspace mode; otherwise the whole name. May be called with any node.- Specified by:
getLocalName
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getNamespaceURI
Description copied from interface:DocumentClient
Returns null iff node is neither Element nor Attribute; otherwise the URI the namespace prefix is bound to. May be called with any node.- Specified by:
getNamespaceURI
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getNamespaceName
Description copied from interface:DocumentClient
Returns null iff node is neither Element nor Attribute; otherwise the NamespaceName. May be called with any node.- Specified by:
getNamespaceName
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getBaseURI
Returns null iff not possible to find out.- Specified by:
getBaseURI
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getDocument
The xpath core library "document()" function has complicated signatures, but finally breaks down to load a document from an URI. This implementation needs any fragment id to be stripped, i.e. loads only COMPLETE documents (which can be inadequate for very large text bodies!-)
The parser is in NON-validating mode, because no DTD/schema is accessible.- Specified by:
getDocument
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getRoot
Description copied from interface:DocumentClient
returns the owning Document. May be called with any node.- Specified by:
getRoot
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
stringValue
Description copied from interface:DocumentClient
Never returns null, but possibly empty String [XPath 1.0:5]. May be called with any node.- Specified by:
stringValue
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
documentOrder
- Specified by:
documentOrder
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
attributeAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all attribute nodes. Is an empty set for all nodes which are not elements. May be called with any node.- Specified by:
attributeAxis
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
childAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all child elements. FIXME STIMMT DAS ALLES ??- Specified by:
childAxis
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
childAxis
-
followingSiblingAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all following sibling elements. May be called with any node.- Specified by:
followingSiblingAxis
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getParent
Description copied from interface:DocumentClient
returns the parent node; null for Document. May be called with any node.- Specified by:
getParent
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getPITarget
Description copied from interface:DocumentClient
returns the target identifier; may only be called with a PI-node!- Specified by:
getPITarget
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
parentAxis
Description copied from interface:DocumentClient
Returns a NodeSet with the one direct parent. May be called with any node.- Specified by:
parentAxis
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
precedingSiblingAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all preceding sibling elements. May be called with any node.- Specified by:
precedingSiblingAxis
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
nameTest
uri and suffix may be ==null, which means "not tested". This is different from being the empty String.- Specified by:
nameTest
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
commentTest
Description copied from interface:DocumentClient
Returns whether a node is a comment. May be called with any node.- Specified by:
commentTest
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
textTest
Description copied from interface:DocumentClient
Returns whether a node is PCDATA. May be called with any node.- Specified by:
textTest
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
processingInstructionTest
Description copied from interface:DocumentClient
Returns whether a node is PI. target==null: returns true if node is any process instruction.
target!=null: returns true if node is a process instruction for this special target.
May be called with any node.- Specified by:
processingInstructionTest
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-
getElementById
Description copied from interface:DocumentClient
retrieves an element (or null) by the text value of the ID-type attribute. Each Element may define 0 or 1 of this attribute.- Specified by:
getElementById
in interfaceDocumentClient<E extends TypedElement<E,
X>>
-