org.jaxen.expr
Class DefaultNameStep
java.lang.Object
org.jaxen.expr.DefaultStep
org.jaxen.expr.DefaultNameStep
- All Implemented Interfaces:
- NameStep, Predicated, java.io.Serializable, Step, Visitable
- public class DefaultNameStep
- extends DefaultStep
- implements NameStep
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".
- Author:
- bob mcwhirter (bob@werken.com)
- See Also:
- Serialized Form
Field Summary |
(package private) boolean |
hasPrefix
Quick flag denoting if we have a namespace prefix |
private java.lang.String |
localName
Our local-name. |
private boolean |
matchesAnyName
Quick flag denoting if the localname was '*' |
private java.lang.String |
prefix
Our prefix, bound through the current Context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
prefix
private java.lang.String prefix
- Our prefix, bound through the current Context.
The empty-string ("") if no prefix was specified.
Decidedly NOT-NULL, due to SAXPath constraints.
localName
private java.lang.String localName
- Our local-name.
matchesAnyName
private boolean matchesAnyName
- Quick flag denoting if the localname was '*'
hasPrefix
boolean hasPrefix
- Quick flag denoting if we have a namespace prefix
DefaultNameStep
public DefaultNameStep(IterableAxis axis,
java.lang.String prefix,
java.lang.String localName,
PredicateSet predicateSet)
getPrefix
public java.lang.String getPrefix()
- Specified by:
getPrefix
in interface NameStep
getLocalName
public java.lang.String getLocalName()
- Specified by:
getLocalName
in interface NameStep
isMatchesAnyName
public boolean isMatchesAnyName()
getText
public java.lang.String getText()
- Specified by:
getText
in interface Step
- Overrides:
getText
in class DefaultStep
toString
public java.lang.String toString()
- Overrides:
toString
in class DefaultStep
matches
public boolean matches(java.lang.Object node,
ContextSupport contextSupport)
- Description copied from interface:
Step
- Performs the node-test part of evaluating the step for the given node
(which must be on the axis).
- Specified by:
matches
in interface Step
hasNamespace
private boolean hasNamespace(java.lang.String uri)
matchesNamespaceURIs
protected boolean matchesNamespaceURIs(java.lang.String u1,
java.lang.String u2)
- Returns:
- true if the two namespace URIs are equal
Note that we may wish to consider null being equal to ""
accept
public void accept(Visitor visitor)
- Specified by:
accept
in interface Visitable