org.jaxen.expr
Class DefaultNameStep
- NameStep, Predicated, Serializable, Step, Visitable
public class DefaultNameStep
Expression object that represents any flavor
of name-test steps within an XPath.
This includes simple steps, such as "foo",
non-default-axis steps, such as "following-sibling::foo"
or "@foo", and namespace-aware steps, such
as "foo:bar".
- bob mcwhirter (bob@werken.com)
- Stephen Colebourne
private boolean | hasPrefix - Quick flag denoting if we have a namespace prefix *
|
private String | localName - Our local-name.
|
private boolean | matchesAnyName - Quick flag denoting if the local name was '*'
|
private String | prefix - Our prefix, bound through the current Context.
|
private static long | serialVersionUID
|
void | accept(Visitor visitor) - Visitor pattern for the step.
|
List | evaluate(Context context) - Evaluate the context node set to find the new node set.
|
String | getLocalName() - Gets the local name.
|
String | getPrefix() - Gets the namespace prefix.
|
String | getText() - Gets the step as a fully defined XPath.
|
private boolean | hasNamespace(String uri) - Checks whether the URI represents a namespace.
|
boolean | isMatchesAnyName() - Does this step match any name? (i.e.
|
boolean | matches(Object node, ContextSupport contextSupport) - Checks whether the node matches this step.
|
protected boolean | matchesNamespaceURIs(String uri1, String uri2) - Compares two namespace URIs, handling null.
|
String | toString() - Returns a full information debugging string.
|
addPredicate , axisIterator , evaluate , getAxis , getAxisName , getIterableAxis , getPredicateSet , getPredicates , getText , simplify , toString |
hasPrefix
private boolean hasPrefix
Quick flag denoting if we have a namespace prefix *
localName
private String localName
Our local-name.
This is the 'bar' in 'foo:bar'.
matchesAnyName
private boolean matchesAnyName
Quick flag denoting if the local name was '*'
prefix
private String prefix
Our prefix, bound through the current Context.
The empty-string ("") if no prefix was specified.
Decidedly NOT-NULL, due to SAXPath constraints.
This is the 'foo' in 'foo:bar'.
serialVersionUID
private static final long serialVersionUID
DefaultNameStep
public DefaultNameStep(IterableAxis axis,
String prefix,
String localName,
PredicateSet predicateSet)
Constructor.
axis
- the axis to work throughprefix
- the name prefixlocalName
- the local namepredicateSet
- the set of predicates
accept
public void accept(Visitor visitor)
Visitor pattern for the step.
- accept in interface Visitable
visitor
- the visitor object
getPrefix
public String getPrefix()
Gets the namespace prefix.
- getPrefix in interface NameStep
getText
public String getText()
Gets the step as a fully defined XPath.
- getText in interface Step
- getText in interface DefaultStep
- the full XPath for this step
hasNamespace
private boolean hasNamespace(String uri)
Checks whether the URI represents a namespace.
- true if non-null and non-empty
isMatchesAnyName
public boolean isMatchesAnyName()
Does this step match any name? (i.e. Is it '*'?)
- true if it matches any name
matches
public boolean matches(Object node,
ContextSupport contextSupport)
throws JaxenException
Checks whether the node matches this step.
- matches in interface Step
node
- the node to checkcontextSupport
- the context support
matchesNamespaceURIs
protected boolean matchesNamespaceURIs(String uri1,
String uri2)
Compares two namespace URIs, handling null.
uri1
- the first URIuri2
- the second URI
- true if equal, where null==""
toString
public String toString()
Returns a full information debugging string.
- toString in interface DefaultStep