|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectPropertyDescriptorImpl
AttributeDescriptorImpl
DefaultAttributeType
public class DefaultAttributeType
Simple, immutable class to store attributes. This class should be sufficient for all simple (ie. non-schema) attribute implementations of this interface.
modules/library/legacy (gt-legacy.jar)
Field Summary |
---|
Fields inherited from class AttributeDescriptorImpl |
---|
defaultValue |
Fields inherited from class PropertyDescriptorImpl |
---|
isNillable, maxOccurs, minOccurs, name, type |
Fields inherited from interface AttributeType |
---|
UNBOUNDED |
Constructor Summary | |
---|---|
protected |
DefaultAttributeType(AttributeType copy)
|
|
DefaultAttributeType(AttributeType type,
Name name,
int min,
int max,
boolean isNillable,
Object defaultValue)
|
protected |
DefaultAttributeType(AttributeType type,
String name,
boolean nillable,
int min,
int max,
Object defaultValue)
|
protected |
DefaultAttributeType(String name,
Class type,
boolean nillable,
int min,
int max,
Object defaultValue)
|
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,
Object defaultValue)
|
Method Summary | |
---|---|
static AttributeType |
createAttributeType(String name,
Class binding,
Filter restriction)
Method for geotools AttributeType implementations to create a geoapi attribute type. |
Object |
createDefaultValue()
Create a default value for this AttributeType. |
Object |
duplicate(Object src)
Return a safe Object copy. |
boolean |
equals(Object other)
Override of equals. |
Class |
getBinding()
Gets the type of this attribute. |
static Class |
getBinding(AttributeType type)
|
String |
getLocalName()
Gets the name of this attribute. |
static String |
getLocalName(AttributeType type)
|
Filter |
getRestriction()
This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string. |
static Filter |
getRestriction(AttributeType type)
|
int |
hashCode()
Override of hashCode. |
boolean |
isGeometry()
Returns whether the attribute is a geometry. |
Object |
parse(Object value)
Allows this AttributeType to convert an argument to its prefered storage type. |
String |
toString()
Gets a representation of this object as a string. |
void |
validate(Object attribute)
Whether the tested object passes the validity constraints of this AttributeType. |
Methods inherited from class AttributeDescriptorImpl |
---|
getDefaultValue, getType |
Methods inherited from class PropertyDescriptorImpl |
---|
getMaxOccurs, getMinOccurs, getName, getUserData, isNillable |
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface AttributeType |
---|
getMaxOccurs, getMinOccurs, isNillable |
Methods inherited from interface AttributeDescriptor |
---|
getDefaultValue, getType |
Methods inherited from interface PropertyDescriptor |
---|
getName, getUserData |
Constructor Detail |
---|
protected DefaultAttributeType(String name, Class type, boolean nillable, int min, int max, 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.min
- max
- defaultValue
- default value when none is suppledf
- protected DefaultAttributeType(AttributeType type, String name, boolean nillable, int min, int max, Object defaultValue)
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)
public DefaultAttributeType(AttributeType type, Name name, int min, int max, boolean isNillable, Object defaultValue)
Method Detail |
---|
public String getLocalName()
getLocalName
in interface AttributeType
getLocalName
in interface AttributeDescriptor
getLocalName
in class AttributeDescriptorImpl
PropertyDescriptor.getName()
public Class getBinding()
getBinding
in interface AttributeType
AttributeDescriptor.getType()
public Object duplicate(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 AttributeType
src
- The Object to duplicate.
IllegalAttributeException
- if the Object cannot be duplicated.public int hashCode()
hashCode
in class AttributeDescriptorImpl
public boolean equals(Object other)
equals
in class AttributeDescriptorImpl
other
- the object to be tested for equality.
public boolean isGeometry()
public String toString()
toString
in class AttributeDescriptorImpl
public final Object parse(Object value) throws IllegalArgumentException
parse
in interface AttributeType
value
- 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.
IllegalArgumentException
- if parsing is attempted and is
unsuccessful.public void validate(Object attribute) throws IllegalArgumentException
getBinding()
, 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 AttributeType
attribute
- The object to be tested for validity.
IllegalArgumentException
- if the object does not validate.public Object createDefaultValue()
AttributeType
createDefaultValue
in interface AttributeType
public Filter getRestriction()
AttributeType
getRestriction
in interface AttributeType
public static AttributeType createAttributeType(String name, Class binding, Filter restriction)
This method is usually called from the constructors of the old AttributeType implememtnations.
name
- THe attribute type name.binding
- The attribute type binding.restriction
- Restriction on the attribute type.
public static String getLocalName(AttributeType type)
public static Class getBinding(AttributeType type)
public static Filter getRestriction(AttributeType type)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |