| java.lang.Object org.geotools.feature.DefaultAttributeType
All known Subclasses: org.geotools.feature.type.TemporalAttributeType, org.geotools.feature.MultiAttributeType, org.geotools.feature.type.TextualAttributeType, org.geotools.xml.gml.ChoiceAttributeTypeImpl, org.geotools.feature.type.NumericAttributeType, org.geotools.feature.type.GeometricAttributeType,
DefaultAttributeType | public class DefaultAttributeType implements AttributeType(Code) | | Simple, immutable class to store attributes. This class should be
sufficient for all simple (ie. non-schema) attribute implementations of
this interface.
author: Rob Hranac, VFNY author: Chris Holmes, TOPP author: Ian Schneider version: $Id: DefaultAttributeType.java 27881 2007-11-13 16:29:42Z aaime $ |
Constructor Summary | |
protected | DefaultAttributeType(String name, Class type, boolean nillable, int min, int max, Object defaultValue, Filter f) Constructor with name and type. | protected | DefaultAttributeType(String name, Class type, boolean nillable, int min, int max, Object defaultValue) | protected | DefaultAttributeType(String name, Class type, boolean nillable, Object defaultValue) | protected | DefaultAttributeType(AttributeType copy) |
minmax | final protected int minmax(Code) | | min/max
|
name | final protected String name(Code) | | Name of this attribute.
|
nillable | final protected boolean nillable(Code) | | Indicates if nulls are allowed for this attribute
|
type | final protected Class type(Code) | | Class type of this attribute.
|
DefaultAttributeType | protected DefaultAttributeType(String name, Class type, boolean nillable, int min, int max, Object defaultValue, Filter f)(Code) | | Constructor with name and type.
Parameters: name - Name of this attribute. Parameters: type - Class type of this attribute. Parameters: nillable - If nulls are allowed for the attribute of this type. Parameters: min - Parameters: max - Parameters: defaultValue - default value when none is suppled Parameters: f - |
DefaultAttributeType | protected DefaultAttributeType(String name, Class type, boolean nillable, int min, int max, Object defaultValue)(Code) | | |
DefaultAttributeType | protected DefaultAttributeType(String name, Class type, boolean nillable, Object defaultValue)(Code) | | |
duplicate | public Object duplicate(Object src) throws IllegalAttributeException(Code) | | Return a safe Object copy.
Obtain a duplicate Object if the object is mutable, or the same Object
reference if it is immutable.
A duplicated Object if the type is mutable or the same Objectif it is immutable or null if the passed Object is null. throws: IllegalAttributeException - if the Object cannot be duplicated. |
equals | public boolean equals(Object other)(Code) | | Override of equals.
Parameters: other - the object to be tested for equality. whether other is equal to this attribute Type. |
getMaxOccurs | public int getMaxOccurs()(Code) | | Defaults are flat, always return 1.
|
getMinOccurs | public int getMinOccurs()(Code) | | Defaults are flat, always return 1.
|
getName | final public String getName()(Code) | | Gets the name of this attribute.
The name of this attribute. |
getRestriction | public Filter getRestriction()(Code) | | |
getType | final public Class getType()(Code) | | Gets the type of this attribute. All attributes that are assigned to
this AttributeType must be an instance of this class. Subclasses are
allowed as well.
The class that the attribute must match to be valid for thisAttributeType. |
hashCode | public int hashCode()(Code) | | Override of hashCode.
hashCode for this object. |
isGeometry | public boolean isGeometry()(Code) | | Returns whether the attribute is a geometry.
true if the attribute's type is a geometry. |
isNillable | public boolean isNillable()(Code) | | Returns whether nulls are allowed for this attribute.
true if nulls are permitted, false otherwise. |
parse | public Object parse(Object value) throws IllegalArgumentException(Code) | | Allows this AttributeType to convert an argument to its prefered storage
type. If no parsing is possible, returns the original value. If a parse
is attempted, yet fails (i.e. a poor decimal format) throw the
Exception. This is mostly for use internally in Features, but
implementors should simply follow the rules to be safe.
Parameters: value - the object to attempt parsing of. value converted to the preferred storage of thisAttributeType . If no parsing was possible thenthe same object is returned. throws: IllegalArgumentException - if parsing is attempted and isunsuccessful. |
toString | public String toString()(Code) | | Gets a representation of this object as a string.
A representation of this object as a string |
validate | public void validate(Object attribute) throws IllegalArgumentException(Code) | | Whether the tested object passes the validity constraints of this
AttributeType. At a minimum it should be of the correct class
specified by
DefaultAttributeType.getType() , non-null if isNillable is
false, and a geometry if isGeometry is true. If The
object does not validate then an IllegalArgumentException reporting the
error in validation should be thrown.
Parameters: attribute - The object to be tested for validity. throws: IllegalArgumentException - if the object does not validate. |
|
|