com.caucho.xpath.pattern
Class NSNamePattern

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

public class NSNamePattern
extends AbstractPattern

Matches a named node, like foo:para or @foo:id when the prefix maps to a namespace.


Field Summary
 
Fields inherited from class com.caucho.xpath.pattern.AbstractPattern
_child, _parent, log, XMLNS
 
Constructor Summary
NSNamePattern(AbstractPattern parent, java.lang.String namespace, java.lang.String local, int nodeType)
          Creates the namespace 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.
 double getPriority()
          Nodes have a higher default priority.
 boolean match(org.w3c.dom.Node node, ExprEnvironment env)
          Matches if the namespace matches and the local name matches.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.xpath.pattern.AbstractPattern
copyAxis, count, createNodeIterator, findAny, firstNode, getNodeName, 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

NSNamePattern

public NSNamePattern(AbstractPattern parent,
                     java.lang.String namespace,
                     java.lang.String local,
                     int nodeType)
Creates the namespace pattern.

Parameters:
parent - the parent pattern.
namespace - the node's namespace URL.
local - the node's local name.
nodeType - the node type to match.
Method Detail

getPriority

public double getPriority()
Nodes have a higher default priority.

Overrides:
getPriority in class AbstractPattern

match

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

Specified by:
match in class AbstractPattern
Parameters:
node - the current node
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()
Overrides:
toString in class java.lang.Object