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

org.deegree.io.datastore
Class PropertyPathResolver

java.lang.Object
  extended by org.deegree.io.datastore.PropertyPathResolver

public class PropertyPathResolver
extends java.lang.Object

Helper class that resolves PropertyPath instances (e.g. PropertyName elements in GetFeature) against the property structure of MappedFeatureTypes.

Version:
$Revision: 20808 $, $Date: 2009-11-16 14:03:13 +0100 (Mo, 16 Nov 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Constructor Summary
PropertyPathResolver()
           
 
Method Summary
static java.util.Map<MappedPropertyType,java.util.Collection<PropertyPath>> determineFetchProperties(MappedFeatureType ft, java.lang.String alias, PropertyPath[] requestedPaths)
          Determines the properties of the given feature type that have to be fetched based on the requested property paths.
static PropertyPath[] determineSubPropertyPaths(MappedFeatureType featureType, java.util.Collection<PropertyPath> propertyPaths)
          Determines the sub property paths that are needed to fetch the given property paths for the also given property.
static PropertyPath normalizePropertyPath(MappedFeatureType ft, java.lang.String alias, PropertyPath path)
          Ensures that the requested property begins with a "feature type step" (this may also be an alias).
static java.util.List<PropertyPath>[] normalizePropertyPaths(MappedFeatureType[] fts, java.lang.String[] ftAliases, PropertyPath[] paths)
          Ensures that all requested properties begin with a feature type (or alias) step.
static PropertyPath[] normalizePropertyPaths(MappedFeatureType ft, java.lang.String alias, PropertyPath[] paths)
          Ensures that all requested properties begin with a feature type step or an alias.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyPathResolver

public PropertyPathResolver()
Method Detail

normalizePropertyPath

public static PropertyPath normalizePropertyPath(MappedFeatureType ft,
                                                 java.lang.String alias,
                                                 PropertyPath path)
Ensures that the requested property begins with a "feature type step" (this may also be an alias).

This is necessary, as section 7.4.2 of the Web Feature Implementation Specification 1.1.0 states:

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.

Parameters:
ft - featureType that the requested properties refer to
alias - alias for the feature type (may be null)
path - requested property
Returns:
normalized path, i.e. it begins with a feature type step

normalizePropertyPaths

public static PropertyPath[] normalizePropertyPaths(MappedFeatureType ft,
                                                    java.lang.String alias,
                                                    PropertyPath[] paths)
Ensures that all requested properties begin with a feature type step or an alias.

If no properties are specified at all, a single PropertyPath entry is created that selects the whole feature type.

Parameters:
ft - feature type that the requested properties refer to
alias - alias for the feature type, may be null
paths - requested properties, may not be null
Returns:
normalized paths

normalizePropertyPaths

public static java.util.List<PropertyPath>[] normalizePropertyPaths(MappedFeatureType[] fts,
                                                                    java.lang.String[] ftAliases,
                                                                    PropertyPath[] paths)
                                                             throws PropertyPathResolvingException
Ensures that all requested properties begin with a feature type (or alias) step.

If no properties are specified for a feature type, a single PropertyPath entry is created that selects the whole feature type.

Parameters:
fts - feature types that the requested properties refer to
paths - requested properties, may not be null
Returns:
normalized paths
Throws:
PropertyPathResolvingException

determineFetchProperties

public static java.util.Map<MappedPropertyType,java.util.Collection<PropertyPath>> determineFetchProperties(MappedFeatureType ft,
                                                                                                            java.lang.String alias,
                                                                                                            PropertyPath[] requestedPaths)
                                                                                                     throws PropertyPathResolvingException
Determines the properties of the given feature type that have to be fetched based on the requested property paths.

Returns a helper Map that associates each (requested) property of the feature with the property paths that request it. Note that the returned helper map may contain more properties than specified. This behaviour is due to section 9.2 of the Web Feature Implementation Specification 1.1.0:

In the event that a WFS encounters a query that does not select all mandatory properties of a feature, the WFS will internally augment the property name list to include all mandatory property names.

Note that every requested property path must begin with a step that selects the given feature type.

Parameters:
ft - feature type
alias - alias for the feature type (may be null)
requestedPaths -
Returns:
Map, key class: MappedPropertyType, value class: Collection (of PropertyPath instances)
Throws:
PropertyPathResolvingException

determineSubPropertyPaths

public static PropertyPath[] determineSubPropertyPaths(MappedFeatureType featureType,
                                                       java.util.Collection<PropertyPath> propertyPaths)
Determines the sub property paths that are needed to fetch the given property paths for the also given property.

Parameters:
featureType -
propertyPaths -
Returns:
sub property paths that are needed to fetch the given property paths

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