com.caucho.xpath.pattern
Class NodeTypePattern

java.lang.Object
  extended by com.caucho.xpath.pattern.AbstractPattern
      extended by com.caucho.xpath.pattern.NodeTypePattern

public class NodeTypePattern
extends AbstractPattern

Matches a node without checking the name. e.g. * or @*


Field Summary
static int ANY
           
static int NODE
           
 
Fields inherited from class com.caucho.xpath.pattern.AbstractPattern
_child, _parent, log, XMLNS
 
Method Summary
 AbstractPattern copyPosition()
          Copies the node matching portion of the pattern, i.e.
static AbstractPattern create(AbstractPattern parent, int nodeType)
           
 boolean equals(java.lang.Object b)
          Returns true if the two patterns are equal.
 java.lang.String getNodeName()
          Returns the name of the matching node or '*' if many nodes match.
 int getNodeType()
          Returns the matching node type.
 double getPriority()
          The node-type priority is less than nodes.
 boolean isStrictlyAscending()
          Returns true if the pattern is strictly ascending.
 boolean match(org.w3c.dom.Node node, ExprEnvironment env)
          Matches if the node type matches.
 java.lang.String toString()
          Returns the printable representation of the pattern.
 
Methods inherited from class com.caucho.xpath.pattern.AbstractPattern
copyAxis, count, createNodeIterator, findAny, firstNode, getParent, getPrefix, isAscending, isUnique, lastNode, nextNode, position, select, selectUnique, toPatternString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE

public static final int NODE
See Also:
Constant Field Values

ANY

public static final int ANY
See Also:
Constant Field Values
Method Detail

create

public static AbstractPattern create(AbstractPattern parent,
                                     int nodeType)

getPriority

public double getPriority()
The node-type priority is less than nodes.

Overrides:
getPriority in class AbstractPattern

getNodeName

public java.lang.String getNodeName()
Returns the name of the matching node or '*' if many nodes match.

The Xsl package uses this to speed template matching.

Overrides:
getNodeName in class AbstractPattern

getNodeType

public int getNodeType()
Returns the matching node type.


isStrictlyAscending

public boolean isStrictlyAscending()
Returns true if the pattern is strictly ascending.

Overrides:
isStrictlyAscending in class AbstractPattern

match

public boolean match(org.w3c.dom.Node node,
                     ExprEnvironment env)
              throws XPathException
Matches if the node type matches.

Specified by:
match in class AbstractPattern
Parameters:
node - the current node
env - the variable environment
Returns:
true if the node matches the node type
Throws:
XPathException

copyPosition

public AbstractPattern copyPosition()
Copies the node matching portion of the pattern, i.e. the section only applying to the current axis.

Overrides:
copyPosition in class AbstractPattern

equals

public boolean equals(java.lang.Object b)
Returns true if the two patterns are equal.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns the printable representation of the pattern.

Overrides:
toString in class java.lang.Object