org.geotools.xml
Class DOMXPath

java.lang.Object
  extended byorg.geotools.xml.XPath
      extended byorg.geotools.xml.DOMXPath

public class DOMXPath
extends XPath

XPath implementation that Works with org.w3c.dom.Node objects

Version:
$Revision: 1.9 $
Author:
Jesse Eichar

Nested Class Summary
 
Nested classes inherited from class org.geotools.xml.XPath
XPath.NullIterator
 
Field Summary
 
Fields inherited from class org.geotools.xml.XPath
OP_FIND, OP_NODEPATH, OP_VALUE
 
Constructor Summary
DOMXPath(java.lang.String path)
          Creates a new DOMXPath object.
 
Method Summary
protected  java.util.Iterator getChildren(java.lang.Object o)
          returns an iterator that iterates through all the o's children that are Element objects
protected  java.lang.String getNodeName(java.lang.Object o)
          Returns the node name of the node.
protected  boolean isLegalNode(java.lang.Object o, int operation, boolean isList)
          Tests whether the object passed is a legal node element Legal nodes may differ depending on the type of operation being performed.
protected  java.lang.Object solve(java.util.List path)
          Returns the value of the first TEXT_NODE.
 
Methods inherited from class org.geotools.xml.XPath
find, getTerms, nodeMatch, nodePaths, toString, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DOMXPath

public DOMXPath(java.lang.String path)
Creates a new DOMXPath object.

Parameters:
path - string form of an XPath
Method Detail

solve

protected java.lang.Object solve(java.util.List path)
Returns the value of the first TEXT_NODE. The whitespace is deleted from the value

Specified by:
solve in class XPath
Parameters:
path - The list of the nodes from the root (Not necessarily doc node) and the identified node. Only the last node is actually used in the calculation.
Returns:
the value of the first TEXT_NODE. The whitespace is deleted from the value

getChildren

protected java.util.Iterator getChildren(java.lang.Object o)
returns an iterator that iterates through all the o's children that are Element objects

Specified by:
getChildren in class XPath
Parameters:
o - A Node element
Returns:
an iterator that iterates through all the o's children that are Element objects

getNodeName

protected java.lang.String getNodeName(java.lang.Object o)
Returns the node name of the node. Uses getNodeName()

Specified by:
getNodeName in class XPath
Parameters:
o - A Node object
Returns:
the node name of the node. Uses getNodeName()

isLegalNode

protected boolean isLegalNode(java.lang.Object o,
                              int operation,
                              boolean isList)
Description copied from class: XPath
Tests whether the object passed is a legal node element Legal nodes may differ depending on the type of operation being performed.

Specified by:
isLegalNode in class XPath
Parameters:
o - Object to test
operation - one of the OP_XXX constants
Returns:
true if object o is a valid node object
See Also:
org.geotools.xml.XPath#isLegalNode(java.lang.Object)


Copyright © GeoTools. All Rights Reserved.