org.geotools.feature
Class Schema

Object
  extended by Schema

public class Schema
extends 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
Module:

Constructor Summary
Schema()
           
Schema(FilterFactory filterFactory)
           
Schema(Hints hints)
           
 
Method Summary
static AttributeDescriptor attribute(SimpleFeatureType type, int index)
          Deprecated. use getAttribute( type, index )
static AttributeDescriptor attribute(SimpleFeatureType type, String name)
          Deprecated. use getAttribute( type, name )
static int attributeCount(SimpleFeatureType featureType)
          Walk the provided FeatureType and produce a count of distinct attribtues.
static List attributes(SimpleFeatureType featureType)
          Deprecated. use getAttributes( featureType )
static List attributes(SimpleFeatureType featureType, List list)
          Deprecated. use getAttributes( featureType, list )
static int find(SimpleFeatureType type, String name)
          Deprecated. please use getIndexOf( type, name )
 AttributeDescriptor getAttribute(SimpleFeatureType type, int index)
          Look up based on name in the provided position.
 AttributeDescriptor getAttribute(SimpleFeatureType type, String name)
           
 int getAttributeCount(SimpleFeatureType featureType)
          Walk the provided FeatureType and produce a count of distinct attribtues.
 List getAttributes(SimpleFeatureType featureType)
           
 List getAttributes(SimpleFeatureType featureType, List list)
          This order is to be respected, based on Ancestors and so on.
 int getIndexOf(SimpleFeatureType type, String name)
          Lookup can only really be by name.
 List getNames(SimpleFeatureType featureType)
          Does a quick walk to detect only a list of attribute names.
 List getNames(SimpleFeatureType featureType, List names)
          This order is to be respected, based on Ancestors and so on.
 Filter getRestrictions(SimpleFeatureType featureType, String name)
          Query featureType information the complete restrictions for the indicated name.
 AttributeDescriptor getXPath(SimpleFeatureType type, String xpath)
          Look up based on name in the provided position.
static List names(SimpleFeatureType featureType)
          Deprecated. use getNames( featureType )
static List names(SimpleFeatureType featureType, List names)
          Deprecated. use getNames( featureType, List )
static Filter restriction(SimpleFeatureType featureType, String name)
          Deprecated. please use getRestriction( featureType, name )
static AttributeDescriptor xpath(SimpleFeatureType type, String xpath)
          Deprecated. use getXPath( type, xpath );
 
Methods inherited from class 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(FilterFactory filterFactory)
Method Detail

getAttributeCount

public int getAttributeCount(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 List getNames(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 List getNames(SimpleFeatureType featureType,
                     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 List getAttributes(SimpleFeatureType featureType)

getAttributes

public List getAttributes(SimpleFeatureType featureType,
                          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 Filter getRestrictions(SimpleFeatureType featureType,
                              String name)
Query featureType information the complete restrictions for the indicated name.

Parameters:
featureType -
name -

getIndexOf

public int getIndexOf(SimpleFeatureType type,
                      String name)
Lookup can only really be by name.

Parameters:
type -

getAttribute

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

Parameters:
type - the FeatureType
index - the position

getAttribute

public AttributeDescriptor getAttribute(SimpleFeatureType type,
                                        String name)

getXPath

public AttributeDescriptor getXPath(SimpleFeatureType type,
                                    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(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 AttributeDescriptor attribute(SimpleFeatureType type,
                                            int index)
Deprecated. use getAttribute( type, index )


attribute

public static AttributeDescriptor attribute(SimpleFeatureType type,
                                            String name)
Deprecated. use getAttribute( type, name )


attributes

public static List attributes(SimpleFeatureType featureType)
Deprecated. use getAttributes( featureType )


attributes

public static List attributes(SimpleFeatureType featureType,
                              List list)
Deprecated. use getAttributes( featureType, list )


find

public static int find(SimpleFeatureType type,
                       String name)
Deprecated. please use getIndexOf( type, name )


names

public static List names(SimpleFeatureType featureType)
Deprecated. use getNames( featureType )


names

public static List names(SimpleFeatureType featureType,
                         List names)
Deprecated. use getNames( featureType, List )


restriction

public static Filter restriction(SimpleFeatureType featureType,
                                 String name)
Deprecated. please use getRestriction( featureType, name )


xpath

public static AttributeDescriptor xpath(SimpleFeatureType type,
                                        String xpath)
Deprecated. use getXPath( type, xpath );



Copyright © 1996-2009 Geotools. All Rights Reserved.