deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.ogcbase
Class PropertyPath

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

public class PropertyPath
extends java.lang.Object
implements java.lang.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: 23794 $, $Date: 2010-04-23 15:05:33 +0200 (Fr, 23 Apr 2010) $
Author:
Markus Schneider , last edited by: $Author: aionita $
See Also:
PropertyPathStep

Constructor Summary
PropertyPath(java.util.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(java.lang.Object obj)
           
 java.util.List<PropertyPathStep> getAllSteps()
          Returns all steps of the PropertyPath.
 java.lang.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.
 void setSteps(java.util.List<PropertyPathStep> steps)
          Setter method for steps
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyPath

public PropertyPath(java.util.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.

setSteps

public void setSteps(java.util.List<PropertyPathStep> steps)
Setter method for steps

Parameters:
steps - a list of PropertyPathSteps

getAsString

public java.lang.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 java.util.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 java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.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 java.lang.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.5 (2011/06/29 09:44 build-8-official)

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