Class AttributeImpl

    • Field Detail

      • id

        protected Identifier id
        id of the attribute.
    • Method Detail

      • 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() is true.

        Specified by:
        getIdentifier in interface Attribute
        A unique identifier for the attribute, or null if the attribute is non-identifiable.
      • getType

        public AttributeType getType()
        Description copied from interface: Property
        The type of the 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().

        Specified by:
        getType in interface Attribute
        Specified by:
        getType in interface Property
        getType in class PropertyImpl
        The property type.
        See Also:
      • hashCode

        public int hashCode()
        Override of hashCode.
        hashCode in class PropertyImpl
        hashCode for this object.
      • equals

        public boolean equals​(Object obj)
        Override of equals.
        equals in class PropertyImpl
        obj - the object to be tested for equality.
        whether other is equal to this attribute Type.
      • 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().

        Specified by:
        validate in interface Attribute
      • parse

        protected Object parse​(Object value)
                        throws IllegalArgumentException
        Allows this Attribute to convert an argument to its prefered storage type. If no parsing is possible, returns the original value. If a parse is attempted, yet fails (i.e. a poor decimal format) throw the Exception. This is mostly for use internally in Features, but implementors should simply follow the rules to be safe.
        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.