public final class Step extends Object implements Serializable
A Path is a sequence of Steps. A XPath is the union of one or several Paths (that is, Path|Path ... |Path).
Path
,
XPath
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
Step.Axis
The axis of this step.
|
static class |
Step.Test
The test of this step.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
static Step |
fromString(String s,
PrefixToNamespace prefixToNS)
Equivalent to
fromString(s, prefixToNS, false) . |
static Step |
fromString(String s,
PrefixToNamespace prefixToNS,
boolean allowDefaultNS)
Parses specified string as a Step.
|
Step.Axis |
getAxis()
Returns the axis of this step.
|
Step.Test |
getTest()
Returns the test of this step.
|
Name |
getTestedName()
Returns the name tested by this step if test is
Step.Test.NAME . |
Namespace |
getTestedNamespace()
Returns the name tested by this step if test is
Step.Test.NAMESPACE . |
String |
toString(NamespaceToPrefixes nsToPrefixes)
Returns this Step converted to a parsable string.
|
void |
toString(StringBuilder buffer,
NamespaceToPrefixes nsToPrefixes)
Formats this Step as a parsable string.
|
public static Step fromString(String s, PrefixToNamespace prefixToNS)
fromString(s, prefixToNS, false)
.public static Step fromString(String s, PrefixToNamespace prefixToNS, boolean allowDefaultNS)
s
- string to be parsedprefixToNS
- map used to get namespace corresponding to prefix
found in string; may be null
allowDefaultNS
- when parsing an element name having no prefix,
use the default namespace if anyName.parse(java.lang.String, boolean, com.xmlmind.xml.name.PrefixToNamespace)
public Step.Axis getAxis()
public Step.Test getTest()
public Name getTestedName()
Step.Test.NAME
.
Returns null
otherwise.public Namespace getTestedNamespace()
Step.Test.NAMESPACE
.
Returns null
otherwise.public String toString(NamespaceToPrefixes nsToPrefixes)
nsToPrefixes
- map used to get prefix corresponding to namespace
referenced in this Step; may be null
Name.format(boolean, com.xmlmind.xml.name.NamespaceToPrefixes)
public void toString(StringBuilder buffer, NamespaceToPrefixes nsToPrefixes)
nsToPrefixes
- map used to get prefix corresponding to namespace
referenced in this Step; may be null
buffer
- buffer where formatted string is to be addedName.format(boolean, com.xmlmind.xml.name.NamespaceToPrefixes)