Class PropertyImpl

  • All Implemented Interfaces:
    Property
    Direct Known Subclasses:
    AssociationImpl, AttributeImpl

    public abstract class PropertyImpl
    extends Object
    implements Property
    Implementation of Property.
    Author:
    Justin Deoliveira, The Open Planning Project
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected PropertyDescriptor descriptor
      descriptor of the property
      protected Object value
      content of the property
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object obj)  
      PropertyDescriptor getDescriptor()
      The PropertyDscriptor of the property, null if this is a top-level value.
      Name getName()
      The name of the property with respect to its descriptor.
      PropertyType getType()
      The type of the property.
      Map<Object,​Object> getUserData()
      A map of "user data" which enables applications to store "application-specific" information against a property.
      Object getUserData​(Object key)  
      Object getValue()
      The value or content of the property.
      int hashCode()  
      boolean isNillable()
      Flag indicating if null is an acceptable value for the property.
      void setValue​(Object value)
      Sets the value or content of the property.
      String toString()  
      • Methods inherited from class Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • value

        protected Object value
        content of the property
    • Constructor Detail

    • Method Detail

      • 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 case getDescriptor().isNillable() would be true.

        Specified by:
        getValue in interface Property
        Returns:
        The value of the property.
      • setValue

        public void setValue​(Object value)
        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 if getDescriptor().isNillable() is true.

        Specified by:
        setValue in interface Property
        Parameters:
        value - The new value of the property.
      • getDescriptor

        public PropertyDescriptor getDescriptor()
        Description copied from interface: Property
        The 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.

        Specified by:
        getDescriptor in interface Property
        Returns:
        The property descriptor, null if this is a top-level value.
        See Also:
        ComplexAttribute
      • 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().

        Specified by:
        getName in interface Property
        Returns:
        name of the property.
      • getType

        public PropertyType 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 Property
        Returns:
        The property type.
      • isNillable

        public boolean isNillable()
        Description copied from interface: Property
        Flag indicating if null is an acceptable value for the property.

        This method is convenience for getDescriptor().isNillable().

        Specified by:
        isNillable in interface Property
        Returns:
        true if the value of the property is allowed to be null, otherwise false.
      • 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 interface Property
        Returns:
        A map of user data.
      • getUserData

        public Object getUserData​(Object key)
      • equals

        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Overrides:
        toString in class Object