Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java 1.0.4 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----com.ibm.xml.xpointer.RelTerm
Each relative location term consists of a keyword, followed by arguments that define one or more steps. These location terms provide facilities for navigating forward, backward, up, and down through the element tree. The arguments passed to the keyword determine which node types from that sequence are chosen.
Each keyword is summarized:
Each of the keywords accepts the following arguments:
all
is
given, then all the candidate locations are selected.child(3,DIV1).child(4,DIV2).child(29,P)
child(5)
Constructor Summary | |
RelTerm(int keywordType,
boolean isAll,
int instance,
int nodeType,
java.lang.String elementName,
java.util.Vector attributes)
|
|
RelTerm(int keywordType,
int instance,
int nodeType)
keywordType(instance,nodeType) .
|
|
RelTerm(int keywordType,
boolean isAll,
int nodeType)
keywordType(all,nodeType) .
|
|
RelTerm(int keywordType,
int instance,
java.lang.String elementName)
keywordType(instance,elementName) .
|
|
RelTerm(int keywordType,
java.lang.String elementName)
keywordType(all,elementName) .
|
|
RelTerm(int keywordType,
int instance)
keywordType(instance) .
|
|
RelTerm(int keywordType)
keywordType(all) .
|
Method Summary | |
java.util.Vector | getAttributesVector()
Vector of attribute names and values to further qualify
candidate elements.
|
java.lang.String | getElementName()
|
int | getInstance()
|
int | getNodeType()
|
int | getType()
|
java.lang.String | getTypeName()
|
boolean | isAll()
|
boolean | match(Node child)
|
void | setType(int keywordType)
|
java.lang.String | toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RelTerm(int keywordType, boolean isAll, int instance, int nodeType, java.lang.String elementName, java.util.Vector attributes)
keywordType
- Must be one of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT,
ST_ANCESTOR, ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
isAll
- means all the candidate locations are selected.
If =false
, instance should be specified.
instance
- The nth of the candidate locations is selected.
Only relevant if isAll=false
.
nodeType
- Must be one of: XPointer.NT_NAME, NT_ELEMENT, NT_PI, NT_COMMENT,
NT_TEXT, NT_CDATA, or NT_ALL.
If =NT_NAME
, elementName should be specified.
elementName
- Selects a particular XML element type to count as candidates.
Only relevant if nodeType=NT_NAME
.
attributes
- A vector of attribute name and values to further qualify candidate
elements.
public RelTerm(int keywordType, int instance, int nodeType)
keywordType(instance,nodeType)
.
keywordType
- Must be one of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT,
ST_ANCESTOR, ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
instance
- The nth of the candidate locations is selected.
nodeType
- Must be one of: XPointer.NT_ELEMENT, NT_PI, NT_COMMENT,
NT_TEXT, NT_CDATA, or NT_ALL.
public RelTerm(int keywordType, boolean isAll, int nodeType)
keywordType(all,nodeType)
.
keywordType
- Must be one of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT,
ST_ANCESTOR, ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
isAll
- Should be =true
for this constructor.
nodeType
- Must be one of: XPointer.NT_ELEMENT, NT_PI, NT_COMMENT,
NT_TEXT, NT_CDATA, or NT_ALL.
public RelTerm(int keywordType, int instance, java.lang.String elementName)
keywordType(instance,elementName)
.
keywordType
- Must be one of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT,
ST_ANCESTOR, ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
instance
- The nth of the candidate locations is selected.
elementName
- Selects a particular XML element type to count as candidates.
public RelTerm(int keywordType, java.lang.String elementName)
keywordType(all,elementName)
.
keywordType
- Must be one of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT,
ST_ANCESTOR, ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
elementName
- Selects a particular XML element type to count as candidates.
public RelTerm(int keywordType, int instance)
keywordType(instance)
.
keywordType
- Must be one of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT,
ST_ANCESTOR, ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
instance
- The nth of the candidate locations is selected.
public RelTerm(int keywordType)
keywordType(all)
.
keywordType
- Must be one of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT,
ST_ANCESTOR, ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
Method Detail |
public int getType()
XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT, ST_ANCESTOR,
ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.public void setType(int keywordType)
keywordType
- One of: XPointer.ST_NONE, ST_CHILD, ST_DESCENDANT, ST_ANCESTOR,
ST_PRECEDING, ST_PSIBLING, ST_FOLLOWING, ST_FSIBLING
.
public java.lang.String getTypeName()
child, descendant, ancestor, preceding,
psibling, following, fsibling
.public boolean isAll()
=false
, instance is relevant.public int getInstance()
=false
.public int getNodeType()
=NT_NAME
, elementName is relevant.public java.lang.String getElementName()
=NT_NAME
.public java.util.Vector getAttributesVector()
Vector
of attribute names and values to further qualify
candidate elements.Vector
of RelTermAttribute
.public java.lang.String toString()
keywordType(all)
keywordType(instance)
keywordType(all,elementName)
keywordType(instance,elementName)
keywordType(all,nodeType)
keywordType(instance,nodeType)
keywordType(all,elementName,attributes)
keywordType(instance,elementName,attributes)
keywordType(all,nodeType,attributes)
keywordType(instance,nodeType,attributes)
-
public boolean match(Node child)
=true
if all the above conditions are satisfied;
otherwise, =false
.Contents | Package | Class | Tree | Deprecated | Index | Help | |||
PREV | NEXT | SHOW LISTS | HIDE LISTS |