org.geotools.feature
Class AttributeTypes

java.lang.Object
  extended byorg.geotools.feature.AttributeTypes

public class AttributeTypes
extends java.lang.Object

Proposal: AttributeType utilities class.

Author:
Luca S. Percich, AMA-MI

Field Summary
static int FIELD_LENGTH_UNDEFINED
           
 
Constructor Summary
AttributeTypes()
           
 
Method Summary
static int getFieldLength(AttributeType attr)
           Returns the field length defined via a restrinction for an attribute type
static int getFieldLength(AttributeType attr, int defaultLength)
           Returns the field length defined via a restrinction for an attribute type This should be considered the maximum allowed length for the given attribute, which means: the max number of chars in a string the maximum precision for a float no meaning for Integer, Boolean, Date?
static int getFieldLengthFromFilter(Filter filter)
           Obtains a field length from a filter possibly containing a LengthFunction expression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_LENGTH_UNDEFINED

public static final int FIELD_LENGTH_UNDEFINED
See Also:
Constant Field Values
Constructor Detail

AttributeTypes

public AttributeTypes()
Method Detail

getFieldLength

public static int getFieldLength(AttributeType attr,
                                 int defaultLength)

Returns the field length defined via a restrinction for an attribute type

This should be considered the maximum allowed length for the given attribute, which means:

Parameters:
attr - The attribute type
defaultLength - The default field length
Returns:
The defined field length, or defaultLength if no maximum length has been defined.

getFieldLength

public static int getFieldLength(AttributeType attr)

Returns the field length defined via a restrinction for an attribute type

Parameters:
attr -
Returns:
the defined field length, or FIELD_LENGTH_UNDEFINED if no maximum length has been defined.

getFieldLengthFromFilter

public static int getFieldLengthFromFilter(Filter filter)

Obtains a field length from a filter possibly containing a LengthFunction expression

Parameters:
filter - the given filter
Returns:
The maximum field length found in the filter, or FIELD_LENGTH_UNDEFINED if none was found;


Copyright © GeoTools. All Rights Reserved.