|
XML for Java Compatibility API 2.0.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.xpointer.StringTerm
The StringTerm class provides support for string location terms in XPointers. Absolute and relative location terms have as their target one or more elements. In order to allow text, CDATASections, comments, and PIs to be the target of an XPointer, the string location term is provided.
A string 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).
The string term has the single keyword string
which selects one or more
strings or positions between strings in the location source. The following arguments
may be passed on the string
keyword:
all
,
all occurrences of the string are used as candidates in forming the designated resource.null
SkipLit string is considered to identify the position immediately
preceding each character in the location source. For example, assuming that the element
with ID x37
contains the character string "Thomas", the following
XPointer identifies the position before the third character ("o"):
id(x37).string(3,"")
end
selects the position immediately
following the last character of the match.
XPointer
,
OtherTerm
, Serialized FormConstructor Summary | |
StringTerm(boolean isAll,
int instance,
java.lang.String string,
boolean isPosition,
boolean isEnd,
int position,
int length)
Constructor for specifying length and for full customization. |
|
StringTerm(int instance,
java.lang.String string)
Constructor for string(instance,"string") . |
|
StringTerm(int instance,
java.lang.String string,
boolean isEnd)
Constructor for string(instance,"string",end) . |
|
StringTerm(int instance,
java.lang.String string,
int position)
Constructor for string(instance,"string",position) . |
|
StringTerm(java.lang.String string)
Constructor for string(all,"string") . |
|
StringTerm(java.lang.String string,
boolean isEnd)
Constructor for string(all,"string",end) . |
|
StringTerm(java.lang.String string,
int position)
Constructor for string(all,"string",position) . |
Method Summary | |
int |
getInstance()
Returns the nth occurrence of string to be used in forming the designated resource. |
int |
getLength()
Returns the number of characters to be selected. |
int |
getPosition()
Returns the character offset from the start of the candidate string(s) to the beginning of the desired final string match. |
java.lang.String |
getString()
Returns the candidate string to be found within the location source. |
boolean |
hasPosition()
Returns whether position is specified. |
boolean |
isAll()
Returns whether all occurrences of string are used as candidates in forming the designated resource. |
boolean |
isEnd()
Returns whether to select the position immediately following the last character of the match. |
java.lang.String |
toString()
Returns this string term in the form of either: string(all,"string")
string(instance,"string")
string(all,"string",end)
string(instance,"string",end)
string(all,"string",position)
string(instance,"string",position)
string(all,"string",end,length)
string(instance,"string",end,length)
string(all,"string",position,length)
string(instance,"string",position,length)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public StringTerm(boolean isAll, int instance, java.lang.String string, boolean isPosition, boolean isEnd, int position, int length)
isAll
- =true
if all occurrences of string are used
as candidates in forming the designated resource. If
=false
, instance should be specified.instance
- Select the nth occurrence of string in forming the
designated resource. Only relevant if isAll=false
.string
- The candidate string to be found within the location source.
=null
identifies the position immediately
preceding each character in the location source.isPosition
- =true
if position is specified. If
=false
, isEnd, position,
and length are not relevant.isEnd
- =true
, selects the position immediately
following the last character of the match. If =false
,
position should be specified.position
- Character offset from the start of the candidate string(s) to
the beginning of the desired final string match. Only
relevant if isEnd=false
.length
- Specifies the number of characters to be selected.public StringTerm(int instance, java.lang.String string, int position)
string(instance,"string",position)
.instance
- Select the nth occurrence of string in forming the
designated resource.string
- The candidate string to be found within the location source.
=null
identifies the position immediately
preceding each character in the location source.public StringTerm(java.lang.String string, int position)
string(all,"string",position)
.string
- The candidate string to be found within the location source.
=null
identifies the position immediately
preceding each character in the location source.public StringTerm(int instance, java.lang.String string, boolean isEnd)
string(instance,"string",end)
.instance
- Select the nth occurrence of string in forming the
designated resource.string
- The candidate string to be found within the location source.
=null
identifies the position immediately
preceding each character in the location source.isEnd
- Should be =true
for this constructor.public StringTerm(java.lang.String string, boolean isEnd)
string(all,"string",end)
.string
- The candidate string to be found within the location source.
=null
identifies the position immediately
preceding each character in the location source.isEnd
- Should be =true
for this constructor.public StringTerm(int instance, java.lang.String string)
string(instance,"string")
.instance
- Select the nth occurrence of string in forming the
designated resource.string
- The candidate string to be found within the location source.
=null
identifies the position immediately
preceding each character in the location source.public StringTerm(java.lang.String string)
string(all,"string")
.string
- The candidate string to be found within the location source.
=null
identifies the position immediately
preceding each character in the location source.Method Detail |
public boolean isAll()
=true
if all occurrences of string are used
as candidates in forming the designated resource. If
=false
, instance has relevance.getInstance()
public int getInstance()
=false
.isAll()
public java.lang.String getString()
=null
identifies the
position immediately preceding each character in the location source.public boolean hasPosition()
=true
if position is specified. If
=false
, isEnd, position,
and length are not relevant.isEnd()
,
getPosition()
,
getLength()
public boolean isEnd()
=true
.=true
, selects the position immediately
following the last character of the match.
If =false
, position is relevant.hasPosition()
,
getPosition()
,
getLength()
public int getPosition()
=true
and isEnd=false
.hasPosition()
,
isEnd()
,
getLength()
public int getLength()
=true
.hasPosition()
,
isEnd()
,
getPosition()
public java.lang.String toString()
string(all,"string")
string(instance,"string")
string(all,"string",end)
string(instance,"string",end)
string(all,"string",position)
string(instance,"string",position)
string(all,"string",end,length)
string(instance,"string",end,length)
string(all,"string",position,length)
string(instance,"string",position,length)
|
XML for Java Compatibility API 2.0.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |