org.geotools.feature
Class AttributeTypeFactory

java.lang.Object
  extended byorg.geotools.feature.AttributeTypeFactory
All Implemented Interfaces:
Factory
Direct Known Subclasses:
DefaultAttributeTypeFactory

public abstract class AttributeTypeFactory
extends java.lang.Object
implements Factory

Abstract class for AttributeType factories. Extending classes need only implement createAttributeType

Version:
$Id: AttributeTypeFactory.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
Ian Schneider, USDA-ARS

Constructor Summary
AttributeTypeFactory()
           
 
Method Summary
protected abstract  AttributeType createAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable, Filter restriction, java.lang.Object defaultValue, java.lang.Object metadata)
          Create an AttributeType with the given name, Class, nillability, fieldLength, and provided defaultValue.
protected abstract  AttributeType createAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable, int fieldLength)
          Create an AttributeType with the given name, Class, nillability, and fieldLength, defering the defaultValue to the type of Attribute.
protected abstract  AttributeType createAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable, int fieldLength, java.lang.Object defaultValue)
          Create an AttributeType with the given name, Class, nillability, fieldLength, and provided defaultValue.
protected abstract  AttributeType createAttributeType(java.lang.String name, java.lang.Class type, boolean isNillable, int fieldLength, java.lang.Object defaultValue, java.lang.Object metaData)
          Create a Feature AttributeType which holds the a Feature instance which is of the given FeatureType or null if any arbitrary Feature can be held.
protected abstract  AttributeType createAttributeType(java.lang.String name, FeatureType type, boolean isNillable)
          Create a Feature AttributeType which holds the a Feature instance which is of the given FeatureType or null if any arbitrary Feature can be held.
static AttributeTypeFactory defaultInstance()
          Returns the default attribute factory for the system - constucting a new one if this is first time the method has been called.
 java.util.Map getImplementationHints()
          Returns the implementation hints.
static AttributeType newAttributeType(java.lang.String name, java.lang.Class clazz)
          Convenience method to just specify name and class.
static AttributeType newAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable)
          Creates a new AttributeType with the given name, class and nillable values.
static AttributeType newAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable, Filter restriction, java.lang.Object defaultValue, java.lang.Object metaData)
           
static AttributeType newAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable, int fieldLength)
          Creates a new AttributeType with the given name, class and nillable values.
static AttributeType newAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable, int fieldLength, java.lang.Object defaultValue)
          Creates a new AttributeType with the given name, class and nillable values.
static AttributeType newAttributeType(java.lang.String name, java.lang.Class clazz, boolean isNillable, int fieldLength, java.lang.Object defaultValue, java.lang.Object metaData)
          Creates a new AttributeType with the addition of MetaData.
static AttributeType newAttributeType(java.lang.String name, FeatureType type)
          Constucts a new AttributeType that accepts Feature (specified by a FeatureType).
static AttributeType newAttributeType(java.lang.String name, FeatureType type, boolean isNillable)
          Constucts a new AttributeType that accepts Features (specified by a FeatureType)
static AttributeTypeFactory newInstance()
          Returns a new instance of the current AttributeTypeFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeTypeFactory

public AttributeTypeFactory()
Method Detail

defaultInstance

public static AttributeTypeFactory defaultInstance()
Returns the default attribute factory for the system - constucting a new one if this is first time the method has been called.

Returns:
the default instance of AttributeTypeFactory.

newInstance

public static AttributeTypeFactory newInstance()
Returns a new instance of the current AttributeTypeFactory. If no implementations are found then DefaultAttributeTypeFactory is returned.

Returns:
A new instance of an AttributeTypeFactory.

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             java.lang.Class clazz,
                                             boolean isNillable,
                                             int fieldLength,
                                             java.lang.Object defaultValue)
Creates a new AttributeType with the given name, class and nillable values.

Parameters:
name - The name of the AttributeType to be created.
clazz - The class that objects will validate against.
isNillable - if nulls are allowed in the new type.
Returns:
A new AttributeType of name, clazz and isNillable.

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             java.lang.Class clazz,
                                             boolean isNillable,
                                             int fieldLength,
                                             java.lang.Object defaultValue,
                                             java.lang.Object metaData)
Creates a new AttributeType with the addition of MetaData.

Currently MetaData is used to supply the CoordinateSequence when making a GeometryAttributeType.

Parameters:
name -
clazz -
isNillable -
fieldLength -
defaultValue -
metaData -
Returns:

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             java.lang.Class clazz,
                                             boolean isNillable,
                                             Filter restriction,
                                             java.lang.Object defaultValue,
                                             java.lang.Object metaData)

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             java.lang.Class clazz,
                                             boolean isNillable,
                                             int fieldLength)
Creates a new AttributeType with the given name, class and nillable values.

Parameters:
name - The name of the AttributeType to be created.
clazz - The class that objects will validate against.
isNillable - if nulls are allowed in the new type.
Returns:
A new AttributeType of name, clazz and isNillable.

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             java.lang.Class clazz,
                                             boolean isNillable)
Creates a new AttributeType with the given name, class and nillable values.

Parameters:
name - The name of the AttributeType to be created.
clazz - The class that objects will validate against.
isNillable - if nulls are allowed in the new type.
Returns:
A new AttributeType of name, clazz and isNillable.

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             java.lang.Class clazz)
Convenience method to just specify name and class. Nulls are allowed as attributes by default (isNillable = true).

Parameters:
name - The name of the AttributeType to be created.
clazz - The class that objects will validate against.
Returns:
A new AttributeType of name and clazz.

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             FeatureType type,
                                             boolean isNillable)
Constucts a new AttributeType that accepts Features (specified by a FeatureType)

Parameters:
name - The name of the AttributeType to be created.
type - the FeatureType that features will validate agist
isNillable - true iff nulls are allowed.
Returns:
A new AttributeType of name, type, and isNillable.

newAttributeType

public static AttributeType newAttributeType(java.lang.String name,
                                             FeatureType type)
Constucts a new AttributeType that accepts Feature (specified by a FeatureType). Nulls are allowed as attributes by default (isNillable = true).

Parameters:
name - The name of the AttributeType to be created.
type - the FeatureType that features will validate agist
Returns:
A new AttributeType of name and type.

createAttributeType

protected abstract AttributeType createAttributeType(java.lang.String name,
                                                     java.lang.Class clazz,
                                                     boolean isNillable,
                                                     int fieldLength,
                                                     java.lang.Object defaultValue)
Create an AttributeType with the given name, Class, nillability, fieldLength, and provided defaultValue.

Parameters:
name - The name of the AttributeType to be created.
clazz - The class that objects will validate against.
isNillable - if nulls are allowed in the new type.
Returns:
the new AttributeType
Throws:
java.lang.IllegalArgumentException - If the field is not nillable, yet

createAttributeType

protected abstract AttributeType createAttributeType(java.lang.String name,
                                                     java.lang.Class clazz,
                                                     boolean isNillable,
                                                     Filter restriction,
                                                     java.lang.Object defaultValue,
                                                     java.lang.Object metadata)
Create an AttributeType with the given name, Class, nillability, fieldLength, and provided defaultValue.

Parameters:
name - The name of the AttributeType to be created.
clazz - The class that objects will validate against.
isNillable - if nulls are allowed in the new type.
restriction - Used to limit the valid values
Returns:
the new AttributeType
Throws:
java.lang.IllegalArgumentException - If the field is not nillable, yet

createAttributeType

protected abstract AttributeType createAttributeType(java.lang.String name,
                                                     java.lang.Class clazz,
                                                     boolean isNillable,
                                                     int fieldLength)
Create an AttributeType with the given name, Class, nillability, and fieldLength, defering the defaultValue to the type of Attribute.


createAttributeType

protected abstract AttributeType createAttributeType(java.lang.String name,
                                                     FeatureType type,
                                                     boolean isNillable)
Create a Feature AttributeType which holds the a Feature instance which is of the given FeatureType or null if any arbitrary Feature can be held.

Parameters:
name - The name of the AttributeType to be created.
type - The FeatureType that Features will validate against.
isNillable - if nulls are allowed in the new type.
Returns:
the new AttributeType

createAttributeType

protected abstract AttributeType createAttributeType(java.lang.String name,
                                                     java.lang.Class type,
                                                     boolean isNillable,
                                                     int fieldLength,
                                                     java.lang.Object defaultValue,
                                                     java.lang.Object metaData)
Create a Feature AttributeType which holds the a Feature instance which is of the given FeatureType or null if any arbitrary Feature can be held.

Parameters:
name - The name of the AttributeType to be created.
type - The FeatureType that Features will validate against.
isNillable - if nulls are allowed in the new type.
defaultValue - default value, may be null if isNilable is true
metaData - metadata for attribute type (such as CoordianteReferenceSystem)
Returns:
the new AttributeType

getImplementationHints

public java.util.Map getImplementationHints()
Returns the implementation hints. The default implementation returns en empty map.

Specified by:
getImplementationHints in interface Factory
Returns:
The map of hints, or an empty map if none.


Copyright © GeoTools. All Rights Reserved.