org.deegree.feature.types
Class DynamicAppSchema

java.lang.Object
  extended by org.deegree.feature.types.DynamicAppSchema
All Implemented Interfaces:
AppSchema

public class DynamicAppSchema
extends Object
implements AppSchema

AppSchema that allows to add FeatureTypes during runtime.

Version:
$Revision: 31622 $, $Date: 2011-08-23 18:12:33 +0200 (Tue, 23 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Constructor Summary
DynamicAppSchema()
           
 
Method Summary
 DynamicFeatureType addFeatureType(QName ftName)
          Adds a new DynamicFeatureType for the given feature type name.
 Map<QName,org.apache.xerces.xs.XSElementDeclaration> getAllowedChildElementDecls(org.apache.xerces.xs.XSComplexTypeDefinition type)
          Returns the child elements that the given complex type definition allows for.
 Set<String> getAppNamespaces()
          Returns the application namespaces.
 FeatureType[] getConcreteSubtypes(FeatureType ft)
          Retrieves all concrete substitutions for the given feature type.
 ObjectPropertyType getCustomElDecl(org.apache.xerces.xs.XSElementDeclaration elDecl)
          Returns the ObjectPropertyType for the given element declaration (if it defines an object property).
 FeatureType[] getDirectSubtypes(FeatureType ft)
          Retrieves the direct subtypes for the given feature type.
 DynamicFeatureType getFeatureType(QName ftName)
          Retrieves the feature type with the given name.
 FeatureType[] getFeatureTypes()
          Returns all feature types that are defined in this application schema.
 List<FeatureType> getFeatureTypes(String namespace, boolean includeCollections, boolean includeAbstracts)
          Returns all feature types that are defined in this application schema, limited by the options.
 Map<FeatureType,FeatureType> getFtToSuperFt()
           
 GMLSchemaInfoSet getGMLSchema()
          Returns the underlying GMLSchemaInfoSet
 Map<String,String> getNamespaceBindings()
          Returns the preferred namespace bindings for all namespaces.
 List<String> getNamespacesDependencies(String ns)
          Returns the namespaces that the definitions in the given namespace depend upon (excluding transitive dependencies).
 List<PropertyType> getNewPropertyDecls(FeatureType ft)
          Returns the PropertyTypes from the specified FeatureType declaration that are *not* present in the parent FeatureType or its ancestors.
 FeatureType getParent(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

DynamicAppSchema

public DynamicAppSchema()
Method Detail

addFeatureType

public DynamicFeatureType addFeatureType(QName ftName)
Adds a new DynamicFeatureType for the given feature type name.

Parameters:
ftName - feature type name, must not be null
Returns:
new (and added) feature type instance, never null

getFeatureTypes

public FeatureType[] getFeatureTypes()
Description copied from interface: AppSchema
Returns all feature types that are defined in this application schema.

Specified by:
getFeatureTypes in interface AppSchema
Returns:
all feature types, never null

getFeatureTypes

public List<FeatureType> getFeatureTypes(String namespace,
                                         boolean includeCollections,
                                         boolean includeAbstracts)
Description copied from interface: AppSchema
Returns all feature types that are defined in this application schema, limited by the options.

Specified by:
getFeatureTypes in interface AppSchema
Parameters:
namespace - may be null (include all feature types from all namespaces)
includeCollections - set to true, if feature collection types shall be included, false otherwise
includeAbstracts - set to true, if abstract types shall be included, false otherwise
Returns:
all feature types, never null

getRootFeatureTypes

public FeatureType[] getRootFeatureTypes()
Description copied from interface: AppSchema
Returns all root feature types that are defined in this application schema.

Specified by:
getRootFeatureTypes in interface AppSchema
Returns:
all root feature types, never null

getFeatureType

public DynamicFeatureType getFeatureType(QName ftName)
Description copied from interface: AppSchema
Retrieves the feature type with the given name.

Specified by:
getFeatureType in interface AppSchema
Parameters:
ftName - feature type name to look up, must not be null
Returns:
the feature type with the given name, or null if no such feature type exists

getDirectSubtypes

public FeatureType[] getDirectSubtypes(FeatureType ft)
Description copied from interface: AppSchema
Retrieves the direct subtypes for the given feature type.

Specified by:
getDirectSubtypes in interface AppSchema
Parameters:
ft - feature type, must not be null
Returns:
the direct subtypes of the given feature type (abstract and non-abstract)

getParent

public FeatureType getParent(FeatureType ft)
Description copied from interface: AppSchema
Retrieves the parent feature type for the specified feature type.

Specified by:
getParent in interface AppSchema
Parameters:
ft - feature type, must not be null
Returns:
parent feature type, can be null

getSubtypes

public FeatureType[] getSubtypes(FeatureType ft)
Description copied from interface: AppSchema
Retrieves all substitutions (abstract and non-abstract ones) for the given feature type.

Specified by:
getSubtypes in interface AppSchema
Parameters:
ft - feature type, must not be null
Returns:
all substitutions for the given feature type, never null

getConcreteSubtypes

public FeatureType[] getConcreteSubtypes(FeatureType ft)
Description copied from interface: AppSchema
Retrieves all concrete substitutions for the given feature type.

Specified by:
getConcreteSubtypes in interface AppSchema
Parameters:
ft - feature type, must not be null
Returns:
all concrete substitutions for the given feature type, never null

getGMLSchema

public GMLSchemaInfoSet getGMLSchema()
Description copied from interface: AppSchema
Returns the underlying GMLSchemaInfoSet

Specified by:
getGMLSchema in interface AppSchema
Returns:
the underlying GML schema, can be null (not based on a GML schema)

isSubType

public boolean isSubType(FeatureType ft,
                         FeatureType substitution)
Description copied from interface: AppSchema
Determines whether a feature type is substitutable for another feature type.

This is true, iff substitution is either:

Specified by:
isSubType in interface AppSchema
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 second feature type is a valid substitution for the first one

getNewPropertyDecls

public List<PropertyType> getNewPropertyDecls(FeatureType ft)
Description copied from interface: AppSchema
Returns the PropertyTypes from the specified FeatureType declaration that are *not* present in the parent FeatureType or its ancestors.

Specified by:
getNewPropertyDecls in interface AppSchema
Parameters:
ft - feature type, must not be null
Returns:
list of property declarations, may be empty, but never null

getFtToSuperFt

public Map<FeatureType,FeatureType> getFtToSuperFt()
Specified by:
getFtToSuperFt in interface AppSchema

getNamespaceBindings

public Map<String,String> getNamespaceBindings()
Description copied from interface: AppSchema
Returns the preferred namespace bindings for all namespaces.

Specified by:
getNamespaceBindings in interface AppSchema
Returns:
the preferred namespace bindings for all namespaces, never null

getAllowedChildElementDecls

public Map<QName,org.apache.xerces.xs.XSElementDeclaration> getAllowedChildElementDecls(org.apache.xerces.xs.XSComplexTypeDefinition type)
Description copied from interface: AppSchema
Returns the child elements that the given complex type definition allows for.

TODO: Respect order and cardinality of child elements.

Specified by:
getAllowedChildElementDecls in interface AppSchema
Parameters:
type - complex type definition, must not be null
Returns:
the child elements, never null

getAppNamespaces

public Set<String> getAppNamespaces()
Description copied from interface: AppSchema
Returns the application namespaces.

NOTE: This excludes the GML core namespaces.

Specified by:
getAppNamespaces in interface AppSchema
Returns:
the application namespaces, never null

getNamespacesDependencies

public List<String> getNamespacesDependencies(String ns)
Description copied from interface: AppSchema
Returns the namespaces that the definitions in the given namespace depend upon (excluding transitive dependencies).

Specified by:
getNamespacesDependencies in interface AppSchema
Parameters:
ns - application namespace, must not be null
Returns:
namespace dependencies, may be empty, but never null

getCustomElDecl

public ObjectPropertyType getCustomElDecl(org.apache.xerces.xs.XSElementDeclaration elDecl)
Description copied from interface: AppSchema
Returns the ObjectPropertyType for the given element declaration (if it defines an object property).

Specified by:
getCustomElDecl in interface AppSchema
Parameters:
elDecl - element declaration, must not be null
Returns:
property declaration or null (if the element does not declare an ObjectPropertyType)


Copyright © 2011. All Rights Reserved.