|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface providing the XPath parser with information on a particular object. An inspector is specific to classes of a particular Java type. The inspector will only receive objects of the types for which it is registered.
Inspectors may be manually registered via InspectorManager.registerInspector(Class[], Class)
, or via the
org.eclipse.jet.modelInsecptors
extension point.
An inspector's responsibilies are
INodeInspector.NodeKind
.
For any given object, INodeInspector.getNodeKind(Object)
should always return the same value.
An inspector may choose to implement the following extension interfaces:
INodeInspectorExtension1
- to provide name-based searching of children. This optional extension may provide
efficient resolution of name-based XPath navigations such as $x/foo
.IElementInspector
- provide extra information for objects that are mapped to XPath Elements. This interface must
be implemented if the node inspector's implementation of INodeInspector.getNodeKind(Object)
returns INodeInspector.NodeKind.ELEMENT
.
Nested Class Summary | |
---|---|
static class |
INodeInspector.NodeKind
A type safe enumeration of node kinds recognized by the JET XPath engine. |
Method Summary | |
---|---|
ExpandedName |
expandedNameOf(java.lang.Object node)
Return the expanded name of the node. |
java.lang.Object[] |
getChildren(java.lang.Object node)
Return the child nodes of the context node. |
java.lang.Object |
getDocumentRoot(java.lang.Object node)
Return the document root for the contenxt node. |
INodeInspector.NodeKind |
getNodeKind(java.lang.Object obj)
Return the XPath node kind of the passed object. |
java.lang.Object |
getParent(java.lang.Object obj)
Return the parent of the passed object |
java.lang.String |
nameOf(java.lang.Object node)
Return the 'name' of the node. |
java.lang.String |
stringValueOf(java.lang.Object node)
Return the string value of the passed node. |
boolean |
testExpandedName(java.lang.Object node,
ExpandedName testName)
Determine whether the name of the node matches the passed expanded name. |
Method Detail |
public INodeInspector.NodeKind getNodeKind(java.lang.Object obj)
obj
- an object to inspect. Will not be null
.
null
if not recognized.public java.lang.Object getParent(java.lang.Object obj)
obj
- an object, will not be null
.
null
.public java.lang.String stringValueOf(java.lang.Object node)
node
- the node. Will not be null
.
null
, but may be the empty string.public ExpandedName expandedNameOf(java.lang.Object node)
node
- a node from which an expanded name is sought
null
if the node has not expanded name.public boolean testExpandedName(java.lang.Object node, ExpandedName testName)
testName
- an expanded name
true
if there is a match, false
otherwise.public java.lang.Object getDocumentRoot(java.lang.Object node)
node
- the node. Will not be null
.
null
if a root cannot be determined.public java.lang.Object[] getChildren(java.lang.Object node)
node
- the node. Will not be null
.
null
.public java.lang.String nameOf(java.lang.Object node)
node
-
null
if the node has no name.
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |