|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.feature.DefaultAttributeType
Simple, immutable class to store attributes. This class should be sufficient for all simple (ie. non-schema) attribute implementations of this interface.
| Field Summary | |
protected java.lang.Object |
defaultValue
|
protected int |
max
|
protected int |
min
|
protected java.lang.String |
name
Name of this attribute. |
protected boolean |
nillable
Indicates if nulls are allowed for this attribute |
protected java.lang.Class |
type
Class type of this attribute. |
| Fields inherited from interface org.geotools.feature.AttributeType |
UNBOUNDED |
| Constructor Summary | |
protected |
DefaultAttributeType(AttributeType copy)
|
protected |
DefaultAttributeType(java.lang.String name,
java.lang.Class type,
boolean nillable,
int min,
int max,
java.lang.Object defaultValue)
|
protected |
DefaultAttributeType(java.lang.String name,
java.lang.Class type,
boolean nillable,
int min,
int max,
java.lang.Object defaultValue,
Filter f)
Constructor with name and type. |
protected |
DefaultAttributeType(java.lang.String name,
java.lang.Class type,
boolean nillable,
java.lang.Object defaultValue)
|
| Method Summary | |
java.lang.Object |
createDefaultValue()
Create a default value for this AttributeType. |
java.lang.Object |
duplicate(java.lang.Object src)
Return a safe Object copy. |
boolean |
equals(java.lang.Object other)
Override of equals. |
int |
getMaxOccurs()
Defaults are flat, always return 1. |
int |
getMinOccurs()
Defaults are flat, always return 1. |
java.lang.String |
getName()
Gets the name of this attribute. |
Filter |
getRestriction()
This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string. |
java.lang.Class |
getType()
Gets the type of this attribute. |
int |
hashCode()
Override of hashCode. |
boolean |
isGeometry()
Returns whether the attribute is a geometry. |
boolean |
isNillable()
Returns whether nulls are allowed for this attribute. |
java.lang.Object |
parse(java.lang.Object value)
Allows this AttributeType to convert an argument to its prefered storage type. |
java.lang.String |
toString()
Gets a representation of this object as a string. |
void |
validate(java.lang.Object attribute)
Whether the tested object passes the validity constraints of this AttributeType. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final java.lang.String name
protected final java.lang.Class type
protected final boolean nillable
protected final int min
protected final int max
protected java.lang.Object defaultValue
| Constructor Detail |
protected DefaultAttributeType(java.lang.String name,
java.lang.Class type,
boolean nillable,
int min,
int max,
java.lang.Object defaultValue,
Filter f)
name - Name of this attribute.type - Class type of this attribute.nillable - If nulls are allowed for the attribute of this type.defaultValue - default value when none is suppled
protected DefaultAttributeType(java.lang.String name,
java.lang.Class type,
boolean nillable,
int min,
int max,
java.lang.Object defaultValue)
protected DefaultAttributeType(java.lang.String name,
java.lang.Class type,
boolean nillable,
java.lang.Object defaultValue)
protected DefaultAttributeType(AttributeType copy)
| Method Detail |
public int getMinOccurs()
getMinOccurs in interface AttributeTypepublic int getMaxOccurs()
getMaxOccurs in interface AttributeTypepublic java.lang.String getName()
getName in interface AttributeTypepublic java.lang.Class getType()
getType in interface AttributeTypepublic boolean isNillable()
isNillable in interface AttributeType
public java.lang.Object duplicate(java.lang.Object src)
throws IllegalAttributeException
Obtain a duplicate Object if the object is mutable, or the same Object reference if it is immutable.
duplicate in interface AttributeTypesrc - The Object to duplicate.
IllegalAttributeException - if the Object cannot be duplicated.public int hashCode()
public boolean equals(java.lang.Object other)
other - the object to be tested for equality.
public boolean isGeometry()
public java.lang.String toString()
public java.lang.Object parse(java.lang.Object value)
throws java.lang.IllegalArgumentException
parse in interface AttributeTypevalue - the object to attempt parsing of.
value converted to the preferred storage of this
AttributeType. If no parsing was possible then
the same object is returned.
java.lang.IllegalArgumentException - if parsing is attempted and is
unsuccessful.
public void validate(java.lang.Object attribute)
throws java.lang.IllegalArgumentException
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.
validate in interface AttributeTypeattribute - The object to be tested for validity.
java.lang.IllegalArgumentException - if the object does not validate.public java.lang.Object createDefaultValue()
AttributeType
createDefaultValue in interface AttributeTypepublic Filter getRestriction()
AttributeType
getRestriction in interface AttributeType
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||