Class ReadonlyAttributeDecorator
- Object
-
- ReadonlyAttributeDecorator
-
-
Constructor Summary
Constructors Constructor Description ReadonlyAttributeDecorator(Attribute delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeDescriptor
getDescriptor()
Override ofProperty.getDescriptor()
which type narrows toAttributeDescriptor
.Identifier
getIdentifier()
Unique Identifier for the attribute.Name
getName()
The name of the property with respect to its descriptor.AttributeType
getType()
Override ofProperty.getType()
which type narrows toAttributeType
.Map<Object,Object>
getUserData()
A map of "user data" which enables applications to store "application-specific" information against a property.Object
getValue()
The value or content of the property.boolean
isNillable()
Flag indicating ifnull
is an acceptable value for the property.void
setValue(Object newValue)
Sets the value or content of the property.void
validate()
Check the attribute value against the constraints provided by the AttributeDescriptor.-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface Property
hasUserData
-
-
-
-
Constructor Detail
-
ReadonlyAttributeDecorator
public ReadonlyAttributeDecorator(Attribute delegate)
-
-
Method Detail
-
getType
public AttributeType getType()
Description copied from interface:Attribute
Override ofProperty.getType()
which type narrows toAttributeType
.- Specified by:
getType
in interfaceAttribute
- Specified by:
getType
in interfaceProperty
- Returns:
- The attribute type.
- See Also:
Property.getType()
-
getIdentifier
public Identifier getIdentifier()
Description copied from interface:Attribute
Unique Identifier for the attribute.This value is non-null in the case that
getType().isIdentifiable()
istrue
.- Specified by:
getIdentifier
in interfaceAttribute
- Returns:
- A unique identifier for the attribute, or
null
if the attribute is non-identifiable.
-
getValue
public Object getValue()
Description copied from interface:Property
The value or content of the property.The class of this object is defined by
getType().getBinding()
.This value may be
null
. In this casegetDescriptor().isNillable()
would betrue
.
-
setValue
public void setValue(Object newValue) throws IllegalArgumentException
Description copied from interface:Property
Sets the value or content of the property.The class of newValue should be the same as or a subclass of
getType().getBinding()
.newValue may be
null
ifgetDescriptor().isNillable()
istrue
.- Specified by:
setValue
in interfaceProperty
- Parameters:
newValue
- The new value of the property.- Throws:
IllegalArgumentException
-
getDescriptor
public AttributeDescriptor getDescriptor()
Description copied from interface:Attribute
Override ofProperty.getDescriptor()
which type narrows toAttributeDescriptor
.- Specified by:
getDescriptor
in interfaceAttribute
- Specified by:
getDescriptor
in interfaceProperty
- Returns:
- The attribute descriptor, may be null if this is a top level type
- See Also:
Property.getDescriptor()
-
getName
public Name getName()
Description copied from interface:Property
The name of the property with respect to its descriptor.This method is convenience for
getDescriptor().getName()
.
-
getUserData
public Map<Object,Object> getUserData()
Description copied from interface:Property
A map of "user data" which enables applications to store "application-specific" information against a property.An example of information that may wish to be stored along with an attribute could be its srs information (in the case of a geometric attribute ).
GeometryAttribute attribute = ...; //set the crs CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); attribute.setCRS( crs ); //set the srs attribute.getUserData().put( "srs", "EPSG:4326" );
- Specified by:
getUserData
in interfaceProperty
- Returns:
- A map of user data.
-
isNillable
public boolean isNillable()
Description copied from interface:Property
Flag indicating ifnull
is an acceptable value for the property.This method is convenience for
getDescriptor().isNillable()
.- Specified by:
isNillable
in interfaceProperty
- Returns:
true
if the value of the property is allowed to benull
, otherwisefalse
.
-
validate
public void validate()
Description copied from interface:Attribute
Check the attribute value against the constraints provided by the AttributeDescriptor.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().
-
-