public class AttributeImpl extends PropertyImpl implements Attribute
| Modifier and Type | Field and Description |
|---|---|
protected Identifier |
id
id of the attribute.
|
descriptor, userData, value| Constructor and Description |
|---|
AttributeImpl(Object content,
AttributeDescriptor descriptor,
Identifier id) |
AttributeImpl(Object content,
AttributeType type,
Identifier id) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Override of equals.
|
AttributeDescriptor |
getDescriptor()
The
PropertyDscriptor of the property, null if this is a top-level value. |
Identifier |
getIdentifier()
Unique Identifier for the attribute.
|
AttributeType |
getType()
The type of the property.
|
int |
hashCode()
Override of hashCode.
|
protected Object |
parse(Object value)
Allows this Attribute to convert an argument to its prefered storage type.
|
void |
setValue(Object newValue)
Override of setValue to convert the newValue to specified type if need be.
|
String |
toString() |
void |
validate()
Check the attribute value against the constraints provided by the AttributeDescriptor.
|
getName, getUserData, getValue, isNillablegetName, getUserData, getValue, isNillableprotected Identifier id
public AttributeImpl(Object content, AttributeDescriptor descriptor, Identifier id)
public AttributeImpl(Object content, AttributeType type, Identifier id)
public Identifier getIdentifier()
AttributeThis value is non-null in the case that getType().isIdentifiable() is
true.
getIdentifier in interface Attributenull if the attribute is
non-identifiable.public AttributeDescriptor getDescriptor()
PropertyPropertyDscriptor of the property, null if this is a top-level value.
The descriptor provides information about the property with respect to its containing
entity (more often then not a Feature or ComplexAttribute.
getDescriptor in interface AttributegetDescriptor in interface PropertygetDescriptor in class PropertyImplComplexAttributepublic AttributeType getType()
PropertyThe type contains information about the value or content of the property such as its java class.
This value is also available via getDescriptor().getType().
getType in interface AttributegetType in interface PropertygetType in class PropertyImplProperty.getType()public void setValue(Object newValue) throws IllegalArgumentException, IllegalStateException
setValue in interface PropertysetValue in class PropertyImplnewValue - The new value of the property.IllegalArgumentExceptionIllegalStateExceptionpublic int hashCode()
hashCode in class PropertyImplpublic boolean equals(Object obj)
equals in class PropertyImplother - the object to be tested for equality.public void validate()
AttributePlease note this method checks the value only - it should have the correct java binding, it should only be null if isNillable is true; and if a value is provided it should satisfy all of the restrictions provided.
To check the the number of times an attribute is used (minOccurs and maxOccurs) please use ComplexAttribute.validate().
public String toString()
toString in class PropertyImplprotected Object parse(Object value) throws IllegalArgumentException
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.Copyright © 1996–2019 Geotools. All rights reserved.