deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.feature.types
Class ApplicationSchema

java.lang.Object
  extended by org.deegree.feature.types.ApplicationSchema

public class ApplicationSchema
extends Object

Defines a number of FeatureTypes and their derivation hierarchy.

Some notes:

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$

Constructor Summary
ApplicationSchema(FeatureType[] fts, Map<FeatureType,FeatureType> ftToSuperFt)
          Creates a new ApplicationSchema instance from the given FeatureTypes and their derivation hierarchy.
 
Method Summary
 FeatureType getConcreteSubtypes(FeatureType ft)
          Retrieves all concrete substitutions for the given feature type.
 FeatureType[] getDirectSubtypes(FeatureType ft)
          Retrieves the direct subtypes for the given feature type.
 FeatureType getFeatureType(QName ftName)
          Retrieves the feature type with the given name.
 FeatureType[] getFeatureTypes()
          Returns all feature types that are defined in this application schema.
 ArrayList<FeatureType> getFeatureTypes(boolean includeCollections, boolean includeAbstracts)
          Returns all feature types that are defined in this application schema, limited by the options.
 List<PropertyType<?>> getNewPropertyDeclarations(FeatureType ft)
          Returns the PropertyTypes from the specified FeatureType declaration that are *not* present in the parent FeatureType or its ancestors.
 FeatureType getParentFt(FeatureType ft)
          Retrieves the parent feature type for the specified feature type.
 FeatureType[] getRootFeatureTypes()
          Returns all root feature types that are defined in this application schema.
 FeatureType getSubtypes(FeatureType ft)
          Retrieves all substitutions (abstract and non-abstract ones) for the given feature type.
 boolean isSubType(FeatureType ft, FeatureType substitution)
          Determines whether a feature type is substitutable for another feature type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationSchema

public ApplicationSchema(FeatureType[] fts,
                         Map<FeatureType,FeatureType> ftToSuperFt)
                  throws IllegalArgumentException
Creates a new ApplicationSchema instance from the given FeatureTypes and their derivation hierarchy.

Parameters:
fts - all application feature types (abstract and non-abstract), this must not include any GML base feature types (e.g. gml:_Feature or gml:FeatureCollection)
ftToSuperFt - key: feature type A, value: feature type B (A extends B), this must not include any GML base feature types (e.g. gml:_Feature or gml:FeatureCollection)
Throws:
IllegalArgumentException - if a feature type cannot be resolved (i.e. it is referenced in a property type, but not defined)
Method Detail

getFeatureTypes

public FeatureType[] getFeatureTypes()
Returns all feature types that are defined in this application schema.

Returns:
all feature types, never null

getFeatureTypes

public ArrayList<FeatureType> getFeatureTypes(boolean includeCollections,
                                              boolean includeAbstracts)
Returns all feature types that are defined in this application schema, limited by the options.

Parameters:
includeCollections -
includeAbstracts -
Returns:
all feature types, never null

getRootFeatureTypes

public FeatureType[] getRootFeatureTypes()
Returns all root feature types that are defined in this application schema.

Returns:
all root feature types, never null

getFeatureType

public FeatureType getFeatureType(QName ftName)
Retrieves the feature type with the given name.

Parameters:
ftName - feature type name to look up
Returns:
the feature type with the given name, or null if no such feature type exists

getDirectSubtypes

public FeatureType[] getDirectSubtypes(FeatureType ft)
Retrieves the direct subtypes for the given feature type.

Parameters:
ft - feature type, must not be null
Returns:
the direct subtypes of the given feature type (abstract and non-abstract)

getParentFt

public FeatureType getParentFt(FeatureType ft)
Retrieves the parent feature type for the specified feature type.

Parameters:
ft - feature type, must not be null
Returns:
parent feature type, can be null

getSubtypes

public FeatureType getSubtypes(FeatureType ft)
Retrieves all substitutions (abstract and non-abstract ones) for the given feature type.

Parameters:
ft - feature type, must not be null
Returns:
all substitutions for the given feature type

getConcreteSubtypes

public FeatureType getConcreteSubtypes(FeatureType ft)
Retrieves all concrete substitutions for the given feature type.

Parameters:
ft - feature type, must not be null
Returns:
all concrete substitutions for the given feature type

isSubType

public boolean isSubType(FeatureType ft,
                         FeatureType substitution)
Determines whether a feature type is substitutable for another feature type.

This is true, iff substitution is either:

Parameters:
ft - base feature type, must be part of this schema
substitution - feature type to be checked, must be part of this schema
Returns:
true, if the first feature type is a valid substitution for the second

getNewPropertyDeclarations

public List<PropertyType<?>> getNewPropertyDeclarations(FeatureType ft)
Returns the PropertyTypes from the specified FeatureType declaration that are *not* present in the parent FeatureType or its ancestors.

Parameters:
ft - feature type, must not be null
Returns:
list of property declarations, may be empty, but never null

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

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

]]>