com.caucho.xpath.pattern
Class NodePattern

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

public class NodePattern
extends AbstractPattern

Matches a named node, like para or @id.


Field Summary
 
Fields inherited from class com.caucho.xpath.pattern.AbstractPattern
_child, _parent, log, XMLNS
 
Constructor Summary
NodePattern(AbstractPattern parent, java.lang.String tag, int nodeType)
          Creates a new node-matching pattern.
 
Method Summary
 AbstractPattern copyPosition()
          Copies the position (non-axis) portion of the pattern.
 boolean equals(java.lang.Object b)
          Returns true if the two patterns are equal.
 java.lang.String getNodeName()
          Returns the pattern's matching node name.
 double getPriority()
          All priorities are based on the node priority.
 boolean match(org.w3c.dom.Node node, ExprEnvironment env)
          matches if the node type matches and the node name matches.
 java.lang.String toString()
          Converts the pattern back to its
 
Methods inherited from class com.caucho.xpath.pattern.AbstractPattern
copyAxis, count, createNodeIterator, findAny, firstNode, getParent, getPrefix, isAscending, isStrictlyAscending, isUnique, lastNode, nextNode, position, select, selectUnique, toPatternString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodePattern

public NodePattern(AbstractPattern parent,
                   java.lang.String tag,
                   int nodeType)
Creates a new node-matching pattern.

Method Detail

getPriority

public double getPriority()
All priorities are based on the node priority.

Overrides:
getPriority in class AbstractPattern

getNodeName

public java.lang.String getNodeName()
Returns the pattern's matching node name.

Overrides:
getNodeName in class AbstractPattern

match

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

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

copyPosition

public AbstractPattern copyPosition()
Copies the position (non-axis) portion of the pattern.

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()
Converts the pattern back to its

Overrides:
toString in class java.lang.Object