org.geotools.feature
Class Schema

java.lang.Object
  extended byorg.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:
0.6.0
Author:
Jody Garnett
See Also:
FeatureTypes, FeatureType

Constructor Summary
Schema()
           
 
Method Summary
static int attribtueCount(FeatureType featureType)
          Walk the provided FeatureType and produce a count of distinct attribtues.
static AttributeType attribute(FeatureType type, int index)
          Look up based on name in the provided position.
static AttributeType attribute(FeatureType type, java.lang.String name)
           
static java.util.List attributes(FeatureType featureType)
           
static void attributes(FeatureType featureType, java.util.List list)
          This order is to be respected, based on Ancestors and so on.
static int find(FeatureType type, java.lang.String name)
          Lookup can only really be by name.
static java.util.List names(FeatureType featureType)
          Does a quick walk to detect only a list of attribute names.
static void names(FeatureType featureType, java.util.List names)
          This order is to be respected, based on Ancestors and so on.
static Filter restriction(FeatureType featureType, java.lang.String name)
          Query featureType information the complete restrictions for the indicated name.
static AttributeType xpath(FeatureType type, java.lang.String xpath)
          Look up based on name in the provided position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schema

public Schema()
Method Detail

attribtueCount

public static int attribtueCount(FeatureType featureType)
Walk the provided FeatureType and produce a count of distinct attribtues.

Parameters:
featureType -
Returns:

names

public static java.util.List names(FeatureType 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.

Returns:
Set of unique attribute names

attributes

public static java.util.List attributes(FeatureType featureType)

names

public static void names(FeatureType 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.


attributes

public static void attributes(FeatureType 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.


restriction

public static Filter restriction(FeatureType featureType,
                                 java.lang.String name)
Query featureType information the complete restrictions for the indicated name.

Parameters:
featureType -
name -
Returns:

find

public static int find(FeatureType type,
                       java.lang.String name)
Lookup can only really be by name.

Parameters:
type -
Returns:

attribute

public static AttributeType attribute(FeatureType type,
                                      int index)
Look up based on name in the provided position.

Returns:

attribute

public static AttributeType attribute(FeatureType type,
                                      java.lang.String name)

xpath

public static AttributeType xpath(FeatureType type,
                                  java.lang.String xpath)
Look up based on name in the provided position.

AttributeType needs a xpath based access

Returns:


Copyright © GeoTools. All Rights Reserved.