com.novell.xml.xpath
Class WildcardName

java.lang.Object
  extended bycom.novell.xml.xpath.WildcardName
All Implemented Interfaces:
NodeTest

public class WildcardName
extends Object
implements NodeTest

Class that represents a WildcardName in an XPath production. A WildcardName is of the form: '*' | NCName ':' '*' | QName This implements NodeTest so WildcardName is a NodeTest in a Basis


Constructor Summary
WildcardName(String name, NamespaceContext nsContext)
           
WildcardName(WildcardNameToken token, NamespaceContext nsContext)
          Construct a WildcardName NodeTest from the lexical token
 
Method Summary
 boolean evaluate(Node node)
          Evaluate the NodeTest with respect to the expression context
 String getLocalPart()
          Return the local-part of the WildcardName.
 ExpandedQName getName()
          Return the expanded name associated with this WildcardName
 NamespaceName getNamespaceName()
          Return the namespace name for the prefix, if any.
 String getPrefix()
          Return the prefix for the WildcardName.
protected  void initName(String prefix, String localPart, NamespaceContext nsContext)
          Initialize the namespace uri (if there is a prefix) based on the passed namespace context
 boolean isFullWild()
          Return true if WildcardName corresponds to '*'
 boolean isLocalWild()
          Return true if localWild corresponds to '*' or 'foo:*'
 void setPrincipalNodeType(int principalNodeType)
          Set the node type that this WildcardName matches.
 String toString()
          Provide a readable description for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WildcardName

public WildcardName(WildcardNameToken token,
                    NamespaceContext nsContext)
             throws XPathException
Construct a WildcardName NodeTest from the lexical token

Parameters:
token - token scanned that represents WildcardName

WildcardName

public WildcardName(String name,
                    NamespaceContext nsContext)
             throws XPathException
Method Detail

setPrincipalNodeType

public void setPrincipalNodeType(int principalNodeType)
Set the node type that this WildcardName matches.

Parameters:
principalNodeType - Node.ELEMENT_NODE, Node.ATTRIBUTE_NODE, etc.

evaluate

public boolean evaluate(Node node)
Evaluate the NodeTest with respect to the expression context

Specified by:
evaluate in interface NodeTest
Parameters:
node - node to evaluate
Returns:
true if context Node is matched by NodeTest, false otherwise

getName

public ExpandedQName getName()
Return the expanded name associated with this WildcardName

Returns:
The expanded name

getPrefix

public String getPrefix()
Return the prefix for the WildcardName.

Returns:
The prefix, if any.

getLocalPart

public String getLocalPart()
Return the local-part of the WildcardName.

Returns:
The local-part of the WildcardName.

getNamespaceName

public NamespaceName getNamespaceName()
Return the namespace name for the prefix, if any.

Returns:
The namespace name, or the empty string.

isFullWild

public boolean isFullWild()
Return true if WildcardName corresponds to '*'

Returns:
True if will match any name, false otherwise.

isLocalWild

public boolean isLocalWild()
Return true if localWild corresponds to '*' or 'foo:*'

Returns:
True if will match any name or any name in a namespace, false otherwise.

toString

public String toString()
Provide a readable description for debugging.

Returns:
String representation

initName

protected void initName(String prefix,
                        String localPart,
                        NamespaceContext nsContext)
                 throws XPathException
Initialize the namespace uri (if there is a prefix) based on the passed namespace context

Parameters:
nsContext - The namespace context with which to resolve the prefix
Throws:
XPathException