com.ibm.xcap
Class NodeSelector.ElementStep

java.lang.Object
  extended by com.ibm.xcap.NodeSelector.ElementStep
Enclosing class:
NodeSelector

public static class NodeSelector.ElementStep
extends java.lang.Object

Represent element steps of the node selector not including the terminal selector. Essentially an element defined between two slashes.


Field Summary
protected  NodeSelector.AttrTest attrTest
          The attribute test for the element step *
protected  org.w3c.dom.Element foundElement
          If a document is parsed and an Element is found for the element step *
protected  boolean matchAllElements
          If the name of the step matches all elements *
protected  java.lang.String name
          The name of the element step *
protected  java.lang.String namespace
          The namespace if the namespace binding is found
protected  java.lang.String nsPrefix
          The namespace prefix for the element step *
protected  int position
          The element position *
protected  int qualifier
          The qualifier type *
static int QUALIFIER_TYPE_BY_ATTRIBUTE
          Qualifier by attribute specified for the element step *
static int QUALIFIER_TYPE_BY_POSITION
          Qualifier by position specified for the element step *
static int QUALIFIER_TYPE_BY_POSITION_AND_ATTRIBUTE
          Both qualifier by attribute and position specified for the element step *
static int QUALIFIER_TYPE_NONE
          No qualifier specified for the element step *
protected  java.lang.String step
          The String step in the NodeSelector *
 
Constructor Summary
NodeSelector.ElementStep(java.lang.String step, java.lang.String defaultNamespace)
          Constructs an element step
 
Method Summary
protected  org.w3c.dom.Element findMatchingChild(org.w3c.dom.Element parentElement)
          Finds the matching child element for this element step
 NodeSelector.AttrTest getAttrTest()
          Returns the attribute test for the element
 org.w3c.dom.Element getElement()
          Returns the found Element after parsing a document.
 java.lang.String getName()
          Returns the name of the element
 java.lang.String getNsPrefix()
          Returns the namespace prefix of the element
 int getPosition()
          Returns the position of the element
 int getQualifierType()
          Returns the qualifier type
protected  boolean isMatch(org.w3c.dom.Element element)
          Checks if the element matches this step.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUALIFIER_TYPE_NONE

public static final int QUALIFIER_TYPE_NONE
No qualifier specified for the element step *

See Also:
Constant Field Values

QUALIFIER_TYPE_BY_POSITION

public static final int QUALIFIER_TYPE_BY_POSITION
Qualifier by position specified for the element step *

See Also:
Constant Field Values

QUALIFIER_TYPE_BY_ATTRIBUTE

public static final int QUALIFIER_TYPE_BY_ATTRIBUTE
Qualifier by attribute specified for the element step *

See Also:
Constant Field Values

QUALIFIER_TYPE_BY_POSITION_AND_ATTRIBUTE

public static final int QUALIFIER_TYPE_BY_POSITION_AND_ATTRIBUTE
Both qualifier by attribute and position specified for the element step *

See Also:
Constant Field Values

step

protected java.lang.String step
The String step in the NodeSelector *


nsPrefix

protected java.lang.String nsPrefix
The namespace prefix for the element step *


name

protected java.lang.String name
The name of the element step *


qualifier

protected int qualifier
The qualifier type *


position

protected int position
The element position *


attrTest

protected NodeSelector.AttrTest attrTest
The attribute test for the element step *


foundElement

protected org.w3c.dom.Element foundElement
If a document is parsed and an Element is found for the element step *


matchAllElements

protected boolean matchAllElements
If the name of the step matches all elements *


namespace

protected java.lang.String namespace
The namespace if the namespace binding is found

Constructor Detail

NodeSelector.ElementStep

public NodeSelector.ElementStep(java.lang.String step,
                                java.lang.String defaultNamespace)
                         throws java.net.MalformedURLException
Constructs an element step

Parameters:
step - A step in the node selector that represents an element
Throws:
java.net.MalformedURLException
Method Detail

toString

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

getAttrTest

public NodeSelector.AttrTest getAttrTest()
Returns the attribute test for the element

Returns:
Returns the attribute test for the element

getPosition

public int getPosition()
Returns the position of the element

Returns:
Returns the position of the element

getNsPrefix

public java.lang.String getNsPrefix()
Returns the namespace prefix of the element

Returns:
Returns the namespace prefix of the element

getName

public java.lang.String getName()
Returns the name of the element

Returns:
Returns the name of the element

getQualifierType

public int getQualifierType()
Returns the qualifier type

Returns:
Returns the qualifier type

getElement

public org.w3c.dom.Element getElement()
Returns the found Element after parsing a document.

Returns:
Returns the found Element after parsing a document.

findMatchingChild

protected org.w3c.dom.Element findMatchingChild(org.w3c.dom.Element parentElement)
                                         throws InvalidNodeSelectorException
Finds the matching child element for this element step

Parameters:
parentElement - The parent Element.
Returns:
Returns the matching child element for this element step
Throws:
InvalidNodeSelectorException

isMatch

protected boolean isMatch(org.w3c.dom.Element element)
Checks if the element matches this step. Position matching is ignored for this method.

Parameters:
element - The element to match.
Returns:
Returns true if the element matches the step ignoring positional info.