org.geotools.catalog
Class MetadataXPath
java.lang.Object
org.geotools.xml.XPath
org.geotools.catalog.MetadataXPath
- public class MetadataXPath
- extends XPath
An XPath implementation that searches
MetadataEntity
objects and returns a
MetadataEntity.Element
Object when find is called
and a MetadataEntity
when value is called.
When find or nodePath operations are used
MetadataEntity
,
MetadataEntity.Element
and
MetadataEntity.EntityType
objects are all legal.
However, only MetadataEntity
objects are legal
when calling the value method.
- Version:
- $Revision: 1.9 $
- Author:
- Jesse Eichar
Constructor Summary |
MetadataXPath(java.lang.String xpath)
Creates a new MetadataXPath object. |
Method Summary |
protected java.util.Iterator |
getChildren(java.lang.Object o)
Returns a iterator that returns all the
MetadataEntity.Element children of object o |
protected java.lang.String |
getNodeName(java.lang.Object o)
Returns the 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)
The first element in the list must be a
MetadataEntity and each following element
must be a MetadataEntity.Element
The real value in the Metadata element indicated by the path is returned |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MetadataXPath
public MetadataXPath(java.lang.String xpath)
- Creates a new MetadataXPath object.
- Parameters:
xpath
- A xpath in string representation. XPath
for a
description of how to write XPath expressions
getNodeName
protected java.lang.String getNodeName(java.lang.Object o)
- Returns the name of the Node.
- Specified by:
getNodeName
in class XPath
- Parameters:
o
- MetadataEntity.Element
to find a
name for
- Returns:
- the name of the
MetadataEntity.Element
solve
protected java.lang.Object solve(java.util.List path)
- The first element in the list must be a
MetadataEntity
and each following element
must be a MetadataEntity.Element
The real value in the Metadata element indicated by the path is returned
- Specified by:
solve
in class XPath
- Parameters:
path
- The first element in the list must be a
MetadataEntity
and each following
element must be a
MetadataEntity.Element
- Returns:
- The real value in the Metadata element indicated by the path
getChildren
protected java.util.Iterator getChildren(java.lang.Object o)
- Returns a iterator that returns all the
MetadataEntity.Element
children of object o
- Specified by:
getChildren
in class XPath
- Parameters:
o
- A MetadataEntity
or
MetadataEntity.Element
or a
MetadataEntity.EntityType
- Returns:
- a iterator that returns all the
MetadataEntity.Element
children of
object o
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 testoperation
- 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.