|
XML for Java Compatibility API 2.0.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.xpointer.RelTerm
The RelTerm class provides support for relative location terms in XPointers. A relative term specifies a location in terms of another location, called the location source. The location source is the entire resource if there are no preceding location terms; otherwise it is the location specified by the preceding term (which might be relative to a location term before that).
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)
XPointer
,
RelTermAttribute
,
StringTerm
,
OtherTerm
, Serialized FormConstructor Summary | |
RelTerm(int keywordType)
Constructor for keywordType(all) . |
|
RelTerm(int keywordType,
boolean isAll,
int nodeType)
Constructor for keywordType(all,nodeType) . |
|
RelTerm(int keywordType,
boolean isAll,
int instance,
int nodeType,
java.lang.String elementName,
java.util.Vector attributes)
Constructor for specifying attributes and for full customization. |
|
RelTerm(int keywordType,
int instance)
Constructor for keywordType(instance) . |
|
RelTerm(int keywordType,
int instance,
int nodeType)
Constructor for keywordType(instance,nodeType) . |
|
RelTerm(int keywordType,
int instance,
java.lang.String elementName)
Constructor for keywordType(instance,elementName) . |
|
RelTerm(int keywordType,
java.lang.String elementName)
Constructor for keywordType(all,elementName) . |
Method Summary | |
java.util.Vector |
getAttributesVector()
Returns a Vector of attribute names and values to further qualify
candidate elements. |
java.lang.String |
getElementName()
Returns the name of the element to be selected by this relative term. |
int |
getInstance()
Returns the nth of the candidate locations to be selected by this relative term. |
int |
getNodeType()
Returns the node type to be selected by this relative term. |
int |
getType()
Returns the integer representing the keyword type of this relative term. |
java.lang.String |
getTypeName()
Returns the string keyword type of this relative term. |
boolean |
isAll()
Returns whether all candidate locations are selected by this relative term. |
boolean |
match(org.w3c.dom.Node child)
Returns whether the specified child matches this relative term. |
void |
setType(int keywordType)
Sets the integer representing the keyword type of this relative term. |
java.lang.String |
toString()
Returns this relative term in the form of either: keywordType(all)
keywordType(instance)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
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
.getTypeName()
,
setType(int)
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
.getType()
,
setType(int)
public java.lang.String getTypeName()
child, descendant, ancestor, preceding,
psibling, following, fsibling
.getType()
,
setType(int)
public boolean isAll()
=false
, instance is relevant.getInstance()
public int getInstance()
=false
.isAll()
public int getNodeType()
=NT_NAME
, elementName is relevant.getElementName()
public java.lang.String getElementName()
=NT_NAME
.getNodeType()
public java.util.Vector getAttributesVector()
Vector
of attribute names and values to further qualify
candidate elements.Vector
of RelTermAttribute
.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(org.w3c.dom.Node child)
=true
if all the above conditions are satisfied;
otherwise, =false
.Child
|
XML for Java Compatibility API 2.0.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |