org.translet.processor
Interface LocationPathHandler

All Known Implementing Classes:
NodeCreator

public interface LocationPathHandler

Handler for the enents generated while parsing an xpath.

Please read the xpath specification available at http://www.w3.org/TR/xpath

Author:
Karthikeyan Mariappan.

Field Summary
static short AXES_ANCESTOR
          Constant indicating an ancestor axes
static short AXES_ANCESTOR_OR_SELF
          Constant indicating an ancestor-or-self axes
static short AXES_ATTRIBUTE
          Constant indicating an attribute axes
static short AXES_CHILD
          Constant indicating child axes
static short AXES_DESCENDENT
          Constant indicating descendent axes
static short AXES_DESCENDENT_OR_SELF
          Constant indicating descendent-or-self axes
static short AXES_FOLLOWING
          Constant indicating following axes
static short AXES_FOLLOWING_SIBLING
          Constant indicating following-sibling axes
static short AXES_NAMESPACE
          Constant indicating namespace axes
static short AXES_PARENT
          Constant indicating parent axes
static short AXES_PRECEDING
          Constant indicating preceding axes
static short AXES_PRECEDING_SIBLING
          Constant indicating preceding-sibling axes
static short AXES_SELF
          Constant indicating self axes
static short AXES_UNKNOWN
          Constant indicating that the axes found was not recognized.
 
Method Summary
 void attribute(String attrName)
          Indicates an attribute in the location path.
 void attributeInPredicate(String attrName)
          Indicates that an attribute was found with in the predicate
 void axes(short axescode)
          Indicates that an axes was encountered.
 Node createNode(String nodeName, String namespaceURI, short nodeType)
          Creates a node of the specified type.
 void data(String value)
          Sets the data.
 void endLocationPath()
          Indicates the closing of a LocationPath.
 void endPredicate()
          Indicates the closing of a predicate.
 void endXPath()
          Indicates the closing of an xpath expression.
 Document getDocument()
          Returns the dom document.
 void locationStep(String step)
          Indicates that a location step was found.
 void predicate(PredicateExpr predicate)
          Indicates a predicate in the location path.
 void startLocationPath()
          Indicates the beginning of a LocationPath in an expression.
 void startPredicate()
          Indicates the beginning of a predicate in an expression.
 void startXPath()
          Indicates the beginning of an xpath expression.
 

Field Detail

AXES_ANCESTOR

public static final short AXES_ANCESTOR
Constant indicating an ancestor axes

AXES_ANCESTOR_OR_SELF

public static final short AXES_ANCESTOR_OR_SELF
Constant indicating an ancestor-or-self axes

AXES_ATTRIBUTE

public static final short AXES_ATTRIBUTE
Constant indicating an attribute axes

AXES_CHILD

public static final short AXES_CHILD
Constant indicating child axes

AXES_DESCENDENT

public static final short AXES_DESCENDENT
Constant indicating descendent axes

AXES_DESCENDENT_OR_SELF

public static final short AXES_DESCENDENT_OR_SELF
Constant indicating descendent-or-self axes

AXES_FOLLOWING

public static final short AXES_FOLLOWING
Constant indicating following axes

AXES_FOLLOWING_SIBLING

public static final short AXES_FOLLOWING_SIBLING
Constant indicating following-sibling axes

AXES_NAMESPACE

public static final short AXES_NAMESPACE
Constant indicating namespace axes

AXES_PARENT

public static final short AXES_PARENT
Constant indicating parent axes

AXES_PRECEDING

public static final short AXES_PRECEDING
Constant indicating preceding axes

AXES_PRECEDING_SIBLING

public static final short AXES_PRECEDING_SIBLING
Constant indicating preceding-sibling axes

AXES_SELF

public static final short AXES_SELF
Constant indicating self axes

AXES_UNKNOWN

public static final short AXES_UNKNOWN
Constant indicating that the axes found was not recognized.
Method Detail

startXPath

public void startXPath()
Indicates the beginning of an xpath expression. Typically called before any other events are called.

endXPath

public void endXPath()
Indicates the closing of an xpath expression. Typically called at the end of an expression processing.

startPredicate

public void startPredicate()
Indicates the beginning of a predicate in an expression.

endPredicate

public void endPredicate()
Indicates the closing of a predicate.

startLocationPath

public void startLocationPath()
Indicates the beginning of a LocationPath in an expression.

endLocationPath

public void endLocationPath()
Indicates the closing of a LocationPath.

attributeInPredicate

public void attributeInPredicate(String attrName)
Indicates that an attribute was found with in the predicate

locationStep

public void locationStep(String step)
Indicates that a location step was found.
Parameters:
step - the name of the location step.

axes

public void axes(short axescode)
Indicates that an axes was encountered.
Parameters:
axesname - the name of the axis.

predicate

public void predicate(PredicateExpr predicate)
Indicates a predicate in the location path.
Parameters:
PredicateExpr - encapsulates the elements of the predicate.

attribute

public void attribute(String attrName)
Indicates an attribute in the location path.
Parameters:
name - of the attribute.

data

public void data(String value)
Sets the data.

createNode

public Node createNode(String nodeName,
                       String namespaceURI,
                       short nodeType)
Creates a node of the specified type.
Parameters:
nodeName - - name for the node. Ignored if not appropriate (like in text nodes).
namespaceURI - - namespace for the node. If invalid then, a no-namespace node will be created.
name - nodeType - a node type as specified in the org.w3c.dom.Node interface.
Returns:
node of the specified type.
Throws:
IllegalArgumentException - if the nodeType is doesn't correspond to the values in the Node interface.

getDocument

public Document getDocument()
Returns the dom document.