Qizx/Open v0.3

net.xfra.qizxopen.dm
Class BaseNodeTest

java.lang.Object
  |
  +--net.xfra.qizxopen.dm.BaseNodeTest
All Implemented Interfaces:
NodeTest

public class BaseNodeTest
extends java.lang.Object
implements NodeTest

Tests a node by kind, and by name if appropriate, with wildcards.


Field Summary
 int kind
          Tested kind (ELEMENT TEXT PI COMMENT..., or -1 for node())
 java.lang.String name
          Localname test: null if not specified (* or ns:*)
 Namespace namespace
          Namespace test: null if not specified (* or *:NCName)
 QName qname
          Accelerator, non-null if non-null namespace and name
 
Constructor Summary
BaseNodeTest(int kind, Namespace namespace, java.lang.String name)
           
 
Method Summary
 boolean accepts(int nodeKind, QName nodeName)
           
 boolean accepts(Node node)
           
 int getNodeKind()
          Returns the node kind (Node.ELEMENT, Node.TEXT etc) or -1 if not simple.
 boolean needsNode()
           
 boolean staticallyCheckable()
          Returns true for simple node test (node kind only).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

public int kind
Tested kind (ELEMENT TEXT PI COMMENT..., or -1 for node())


namespace

public Namespace namespace
Namespace test: null if not specified (* or *:NCName)


name

public java.lang.String name
Localname test: null if not specified (* or ns:*)


qname

public QName qname
Accelerator, non-null if non-null namespace and name

Constructor Detail

BaseNodeTest

public BaseNodeTest(int kind,
                    Namespace namespace,
                    java.lang.String name)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNodeKind

public int getNodeKind()
Description copied from interface: NodeTest
Returns the node kind (Node.ELEMENT, Node.TEXT etc) or -1 if not simple.

Specified by:
getNodeKind in interface NodeTest

staticallyCheckable

public boolean staticallyCheckable()
Description copied from interface: NodeTest
Returns true for simple node test (node kind only).

Specified by:
staticallyCheckable in interface NodeTest

accepts

public boolean accepts(int nodeKind,
                       QName nodeName)
Specified by:
accepts in interface NodeTest
Returns:
true if node matched. A null name is always accepted.

needsNode

public boolean needsNode()
Specified by:
needsNode in interface NodeTest
Returns:
true if the node itself is necessary for checking (not only the kind and name). Allows optimization (avoids building a Node just for testing). Returns true for extended tests like DocumentTest.

accepts

public boolean accepts(Node node)
Specified by:
accepts in interface NodeTest
Returns:
true if node matched. Used for extended tests like DocumentTest.

 Copyright Xavier FRANC 2003-2004