Class ReadonlyAttributeDecorator
This class is used by Types in order to protect provided attributes from modification during evaluation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOverride ofProperty.getDescriptor()which type narrows toAttributeDescriptor.Unique Identifier for the attribute.getName()The name of the property with respect to its descriptor.getType()Override ofProperty.getType()which type narrows toAttributeType.A map of "user data" which enables applications to store "application-specific" information against a property.getValue()The value or content of the property.booleanFlag indicating ifnullis an acceptable value for the property.voidSets the value or content of the property.voidvalidate()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, waitMethods inherited from interface Property
hasUserData
-
Constructor Details
-
ReadonlyAttributeDecorator
-
-
Method Details
-
getType
Description copied from interface:AttributeOverride ofProperty.getType()which type narrows toAttributeType. -
getIdentifier
Description copied from interface:AttributeUnique Identifier for the attribute.This value is non-null in the case that
getType().isIdentifiable()istrue.- Specified by:
getIdentifierin interfaceAttribute- Returns:
- A unique identifier for the attribute, or
nullif the attribute is non-identifiable.
-
getValue
Description copied from interface:PropertyThe 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
Description copied from interface:PropertySets 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
nullifgetDescriptor().isNillable()istrue.- Specified by:
setValuein interfaceProperty- Parameters:
newValue- The new value of the property.- Throws:
IllegalArgumentException
-
getDescriptor
Description copied from interface:AttributeOverride ofProperty.getDescriptor()which type narrows toAttributeDescriptor.- Specified by:
getDescriptorin interfaceAttribute- Specified by:
getDescriptorin interfaceProperty- Returns:
- The attribute descriptor, may be null if this is a top level type
- See Also:
-
getName
Description copied from interface:PropertyThe name of the property with respect to its descriptor.This method is convenience for
getDescriptor().getName(). -
getUserData
Description copied from interface:PropertyA 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:
getUserDatain interfaceProperty- Returns:
- A map of user data.
-
isNillable
public boolean isNillable()Description copied from interface:PropertyFlag indicating ifnullis an acceptable value for the property.This method is convenience for
getDescriptor().isNillable().- Specified by:
isNillablein interfaceProperty- Returns:
trueif the value of the property is allowed to benull, otherwisefalse.
-
validate
public void validate()Description copied from interface:AttributeCheck 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().
-