org.geotools.feature
Class Schema

java.lang.Object
  extended by org.geotools.feature.Schema

public class Schema
extends java.lang.Object

This class contains utility methods focused on the schema represented by the FeatureType data model.

These methods are often used for implementation the convience methods such as FeatureType.getAttributeCount(), although they may be used directly with any FeatureType.

These schema methods are based on the *complete* picture indicated by a FeatureType and its ancestors. Many of these methods are focused on the derivation of AttribtueTypes during an override.

Since:
2.1.0
Author:
Jody Garnett
See Also:
FeatureTypes, FeatureType

Constructor Summary
Schema()
           
Schema(org.opengis.filter.FilterFactory filterFactory)
           
Schema(Hints hints)
           
 
Method Summary
static org.opengis.feature.type.AttributeDescriptor attribute(org.opengis.feature.simple.SimpleFeatureType type, int index)
          Deprecated. use getAttribute( type, index )
static org.opengis.feature.type.AttributeDescriptor attribute(org.opengis.feature.simple.SimpleFeatureType type, java.lang.String name)
          Deprecated. use getAttribute( type, name )
static int attributeCount(org.opengis.feature.simple.SimpleFeatureType featureType)
          Walk the provided FeatureType and produce a count of distinct attribtues.
static java.util.List attributes(org.opengis.feature.simple.SimpleFeatureType featureType)
          Deprecated. use getAttributes( featureType )
static java.util.List attributes(org.opengis.feature.simple.SimpleFeatureType featureType, java.util.List list)
          Deprecated. use getAttributes( featureType, list )
static int find(org.opengis.feature.simple.SimpleFeatureType type, java.lang.String name)
          Deprecated. please use getIndexOf( type, name )
 org.opengis.feature.type.AttributeDescriptor getAttribute(org.opengis.feature.simple.SimpleFeatureType type, int index)
          Look up based on name in the provided position.
 org.opengis.feature.type.AttributeDescriptor getAttribute(org.opengis.feature.simple.SimpleFeatureType type, java.lang.String name)
           
 int getAttributeCount(org.opengis.feature.simple.SimpleFeatureType featureType)
          Walk the provided FeatureType and produce a count of distinct attribtues.
 java.util.List getAttributes(org.opengis.feature.simple.SimpleFeatureType featureType)
           
 java.util.List getAttributes(org.opengis.feature.simple.SimpleFeatureType featureType, java.util.List list)
          This order is to be respected, based on Ancestors and so on.
 int getIndexOf(org.opengis.feature.simple.SimpleFeatureType type, java.lang.String name)
          Lookup can only really be by name.
 java.util.List getNames(org.opengis.feature.simple.SimpleFeatureType featureType)
          Does a quick walk to detect only a list of attribute names.
 java.util.List getNames(org.opengis.feature.simple.SimpleFeatureType featureType, java.util.List names)
          This order is to be respected, based on Ancestors and so on.
 org.opengis.filter.Filter getRestrictions(org.opengis.feature.simple.SimpleFeatureType featureType, java.lang.String name)
          Query featureType information the complete restrictions for the indicated name.
 org.opengis.feature.type.AttributeDescriptor getXPath(org.opengis.feature.simple.SimpleFeatureType type, java.lang.String xpath)
          Look up based on name in the provided position.
static java.util.List names(org.opengis.feature.simple.SimpleFeatureType featureType)
          Deprecated. use getNames( featureType )
static java.util.List names(org.opengis.feature.simple.SimpleFeatureType featureType, java.util.List names)
          Deprecated. use getNames( featureType, List )
static org.opengis.filter.Filter restriction(org.opengis.feature.simple.SimpleFeatureType featureType, java.lang.String name)
          Deprecated. please use getRestriction( featureType, name )
static org.opengis.feature.type.AttributeDescriptor xpath(org.opengis.feature.simple.SimpleFeatureType type, java.lang.String xpath)
          Deprecated. use getXPath( type, xpath );
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schema

public Schema()

Schema

public Schema(Hints hints)

Schema

public Schema(org.opengis.filter.FilterFactory filterFactory)
Method Detail

getAttributeCount

public int getAttributeCount(org.opengis.feature.simple.SimpleFeatureType featureType)
Walk the provided FeatureType and produce a count of distinct attribtues.

used to detect duplicate attributes names (ie override)

Parameters:
featureType -

getNames

public java.util.List getNames(org.opengis.feature.simple.SimpleFeatureType featureType)
Does a quick walk to detect only a list of attribute names.

This method does not produce the complete schema (ie derrived restrictions based on attribute facets). It is only used to get a list of the unique attribtues in the resulting schema.

Parameters:
featureType -
Returns:
Set of unique attribute names

getNames

public java.util.List getNames(org.opengis.feature.simple.SimpleFeatureType featureType,
                               java.util.List names)
This order is to be respected, based on Ancestors and so on.

This method is "faster" then actually constructing the merged AttribtueTypes.


getAttributes

public java.util.List getAttributes(org.opengis.feature.simple.SimpleFeatureType featureType)

getAttributes

public java.util.List getAttributes(org.opengis.feature.simple.SimpleFeatureType featureType,
                                    java.util.List list)
This order is to be respected, based on Ancestors and so on.

This method is "faster" then actually constructing the merged AttribtueTypes.


getRestrictions

public org.opengis.filter.Filter getRestrictions(org.opengis.feature.simple.SimpleFeatureType featureType,
                                                 java.lang.String name)
Query featureType information the complete restrictions for the indicated name.

Parameters:
featureType -
name -

getIndexOf

public int getIndexOf(org.opengis.feature.simple.SimpleFeatureType type,
                      java.lang.String name)
Lookup can only really be by name.

Parameters:
type -

getAttribute

public org.opengis.feature.type.AttributeDescriptor getAttribute(org.opengis.feature.simple.SimpleFeatureType type,
                                                                 int index)
Look up based on name in the provided position.

Parameters:
type - the FeatureType
index - the position

getAttribute

public org.opengis.feature.type.AttributeDescriptor getAttribute(org.opengis.feature.simple.SimpleFeatureType type,
                                                                 java.lang.String name)

getXPath

public org.opengis.feature.type.AttributeDescriptor getXPath(org.opengis.feature.simple.SimpleFeatureType type,
                                                             java.lang.String xpath)
Look up based on name in the provided position.

AttributeType needs a xpath based access

Parameters:
type -
xpath -

attributeCount

public static int attributeCount(org.opengis.feature.simple.SimpleFeatureType featureType)
Walk the provided FeatureType and produce a count of distinct attribtues.

used to detect duplicate attributes names (ie override)

Parameters:
featureType -

attribute

public static org.opengis.feature.type.AttributeDescriptor attribute(org.opengis.feature.simple.SimpleFeatureType type,
                                                                     int index)
Deprecated. use getAttribute( type, index )


attribute

public static org.opengis.feature.type.AttributeDescriptor attribute(org.opengis.feature.simple.SimpleFeatureType type,
                                                                     java.lang.String name)
Deprecated. use getAttribute( type, name )


attributes

public static java.util.List attributes(org.opengis.feature.simple.SimpleFeatureType featureType)
Deprecated. use getAttributes( featureType )


attributes

public static java.util.List attributes(org.opengis.feature.simple.SimpleFeatureType featureType,
                                        java.util.List list)
Deprecated. use getAttributes( featureType, list )


find

public static int find(org.opengis.feature.simple.SimpleFeatureType type,
                       java.lang.String name)
Deprecated. please use getIndexOf( type, name )


names

public static java.util.List names(org.opengis.feature.simple.SimpleFeatureType featureType)
Deprecated. use getNames( featureType )


names

public static java.util.List names(org.opengis.feature.simple.SimpleFeatureType featureType,
                                   java.util.List names)
Deprecated. use getNames( featureType, List )


restriction

public static org.opengis.filter.Filter restriction(org.opengis.feature.simple.SimpleFeatureType featureType,
                                                    java.lang.String name)
Deprecated. please use getRestriction( featureType, name )


xpath

public static org.opengis.feature.type.AttributeDescriptor xpath(org.opengis.feature.simple.SimpleFeatureType type,
                                                                 java.lang.String xpath)
Deprecated. use getXPath( type, xpath );



Copyright © 1996-2010 Geotools. All Rights Reserved.