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, isNillable
getName, getUserData, getValue, hasUserData, isNillable
protected Identifier id
public AttributeImpl(Object content, AttributeDescriptor descriptor, Identifier id)
public AttributeImpl(Object content, AttributeType type, Identifier id)
public Identifier getIdentifier()
Attribute
This value is non-null in the case that getType().isIdentifiable()
is
true
.
getIdentifier
in interface Attribute
null
if the attribute is
non-identifiable.public AttributeDescriptor getDescriptor()
Property
PropertyDscriptor
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 Attribute
getDescriptor
in interface Property
getDescriptor
in class PropertyImpl
ComplexAttribute
public AttributeType getType()
Property
The 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 Attribute
getType
in interface Property
getType
in class PropertyImpl
Property.getType()
public void setValue(Object newValue) throws IllegalArgumentException, IllegalStateException
setValue
in interface Property
setValue
in class PropertyImpl
newValue
- The new value of the property.IllegalArgumentException
IllegalStateException
public int hashCode()
hashCode
in class PropertyImpl
public boolean equals(Object obj)
equals
in class PropertyImpl
obj
- the object to be tested for equality.public void validate()
Attribute
Please 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 PropertyImpl
protected 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–2023 Geotools. All rights reserved.