Class com.ibm.xml.xpointer.AbsTerm
java.lang.Object
|
+----com.ibm.xml.xpointer.AbsTerm
- public class AbsTerm
- extends java.lang.Object
- implements java.io.Serializable
The AbsTerm class provides support for absolute location terms in XPointers. An absolute term
selects one or more elements or locations in an XML document without reference to any
other sub-resource location.
The keywords of an absolute term do not depend on the existence of a location source.
They can be used to establish a location source or can serve as self-contained XPointers:
- root()
- The location source is the root element of the containing resource.
If an XPointer omits any leading absolute location term (that is, it consists only of
OtherTerms), it is assumed to have a leading root() absolute location term.
- origin()
- The origin keyword produces a meaningful location source for any following location
terms only if the XPointer is being processed by application software in response to a
request for traversal such as defined in the XLink specification. If an XPointer begins
with origin(), the location source is the sub-resource from which the user initiated
traversal rather than the default root element. This allows XPointers to select abstract
items such as "the next chapter".
- id(Name)
- The location source is the element in the containing resource with an attribute having
a declared type of ID and a case-insensitive value matching the specified Name.
For example, the location term id(a27)
chooses the necessarily unique
element of the containing resource which has an attribute declared to be of type ID whose
value is a27
.
- html("nameValue")
- The location source is the first element whose type is
A
and which has an
attribute called NAME
whose value is the same as the supplied case-sensitive
nameValue. This is exactly the function performed by the "#" fragment
identifier in the context of an HTML document.
- Version:
- Revision: 72 1.4 src/com/ibm/xml/xpointer/AbsTerm.java, xml4jsrc, xml4j-jtcsv, xml4j_1_0_4
- See Also:
- XPointer
Constructor Summary
|
AbsTerm(int type,
java.lang.String param)
Constructor for id(Name) and html(nameValue) .
|
AbsTerm(int type)
Constructor for root() and origin() .
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbsTerm
public AbsTerm(int type,
java.lang.String param)
- Constructor for
id(Name)
and html(nameValue)
.
- Parameters:
type
- An integer representing the keyword type of this absolute term.
Must be one of: XPointer.ST_ID, or XPointer.ST_HTML
.
param
- If type=ST_ROOTID, Name in id(Name)
.
If type=ST_HTML, nameValue (excluding quotes) in html(nameValue)
.
AbsTerm
public AbsTerm(int type)
- Constructor for
root()
and origin()
.
- Parameters:
type
- An integer representing the keyword type of this absolute term.
Must be one of: XPointer.ST_ROOT, XPointer.ST_ORIGIN
.
getType
public int getType()
- Returns the integer representing the keyword type of this absolute term.
- Returns:
- One of:
XPointer.ST_ROOT, XPointer.ST_ORIGIN, XPointer.ST_ID, or XPointer.ST_HTML
. - See Also:
- getTypeName
getTypeName
public java.lang.String getTypeName()
- Returns the string keyword type of this absolute term.
- Returns:
- One of:
root, origin, id, or html
. - See Also:
- getType
getParameter
public java.lang.String getParameter()
- Returns the argument to the keyword of this absolute term.
- Returns:
- If type=ST_ROOTID, Name in
id(Name)
.
If type=ST_HTML, nameValue (excluding quotes) in html(nameValue)
.
Otherwise =null
.
toString
public java.lang.String toString()
- Returns this absolute term in the form of either:
root()
origin()
id(name)
html("nameValue")
- Returns:
- A string represention of this absolute term.
- Overrides:
- toString in class java.lang.Object