deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.ogcbase
Class PropertyPath

java.lang.Object
  extended by org.deegree.ogcbase.PropertyPath
All Implemented Interfaces:
Comparable<PropertyPath>
Direct Known Subclasses:
XLinkPropertyPath

public class PropertyPath
extends Object
implements Comparable<PropertyPath>

Represents a subset of the XPath expression language as described in section 7.4.2 of the Web Feature Implementation Specification 1.1.0 (but is used by other OGC specifications as well).

This specification does not require a WFS implementation to support the full XPath language. In order to keep the implementation entry cost as low as possible, this specification mandates that a WFS implementation must support the following subset of the XPath language:

  1. A WFS implementation must support abbreviated relative location paths.
  2. Relative location paths are composed of one or more steps separated by the path separator '/'.
  3. The first step of a relative location path may correspond to the root element of the feature property being referenced or to the root element of the feature type with the next step corresponding to the root element of the feature property being referenced
  4. Each subsequent step in the path must be composed of the abbreviated form of the child:: axis specifier and the name of the feature property encoded as the principal node type of element. The abbreviated form of the child:: axis specifier is to simply omit the specifier from the location step.
  5. Each step in the path may optionally contain a predicate composed of the predicate delimiters '[' and ']' and a number indicating which child of the context node is to be selected. This allows feature properties that may be repeated to be specifically referenced.
  6. The final step in a path may optionally be composed of the abbreviated form of the attribute:: axis specifier, '@', and the name of a feature property encoded as the principal node type of attribute::.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $
See Also:
PropertyPathStep

Constructor Summary
PropertyPath(List<PropertyPathStep> steps)
          Creates a new instance of PropertyPath with the specified steps.
 
Method Summary
 void append(PropertyPathStep last)
          Adds the given PropertyPathStep to the end of the path.
 int compareTo(PropertyPath that)
          Compares this object with the specified object for order.
 boolean equals(Object obj)
           
 List<PropertyPathStep> getAllSteps()
          Returns all steps of the PropertyPath.
 String getAsString()
          Returns the canonical string representation.
 NamespaceContext getNamespaceContext()
          Returns the namespace bindings for the prefices that are used by this property path.
 PropertyPathStep getStep(int i)
          Returns the PropertyPathStep at the given index.
 int getSteps()
          Returns the number of steps.
 int hashCode()
           
 void prepend(PropertyPathStep first)
          Adds the given PropertyPathStep to the beginning of the path.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyPath

public PropertyPath(List<PropertyPathStep> steps)
Creates a new instance of PropertyPath with the specified steps.

Parameters:
steps - property path steps, may not be null
Method Detail

getNamespaceContext

public NamespaceContext getNamespaceContext()
Returns the namespace bindings for the prefices that are used by this property path.

Returns:
the namespace bindings

getSteps

public int getSteps()
Returns the number of steps.

Returns:
the number of steps.

getAsString

public String getAsString()
Returns the canonical string representation.

Returns:
canonical string representation

getStep

public PropertyPathStep getStep(int i)
Returns the PropertyPathStep at the given index.

Parameters:
i -
Returns:
the PropertyPathStep at the given index

getAllSteps

public List<PropertyPathStep> getAllSteps()
Returns all steps of the PropertyPath.

Returns:
all steps of the PropertyPath

append

public void append(PropertyPathStep last)
Adds the given PropertyPathStep to the end of the path.

Parameters:
last - PropertyPathStep to add

prepend

public void prepend(PropertyPathStep first)
Adds the given PropertyPathStep to the beginning of the path.

Parameters:
first - PropertyPathStep to add

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(PropertyPath that)
Compares this object with the specified object for order.

TODO use really unique string representations (namespaces!) + cache them

Specified by:
compareTo in interface Comparable<PropertyPath>
Parameters:
that - the PropertyPath to be compared
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org