org.springframework.core.convert

Class Property


  • public final class Property
    extends Object
    A description of a JavaBeans Property that allows us to avoid a dependency on java.beans.PropertyDescriptor. The java.beans package is not available in a number of environments (e.g. Android, Java ME), so this is desirable for portability of Spring's core conversion facility.

    Used to build a TypeDescriptor from a property location. The built TypeDescriptor can then be used to convert from/to the property type.

    Since:
    3.1
    Author:
    Keith Donald, Phillip Webb
    See Also:
    TypeDescriptor.TypeDescriptor(Property), TypeDescriptor.nested(Property, int)
    • Constructor Detail

      • Property

        public Property(Class<?> objectType,
                Method readMethod,
                Method writeMethod)
    • Method Detail

      • getObjectType

        public Class<?> getObjectType()
        The object declaring this property, either directly or in a superclass the object extends.
      • getName

        public String getName()
        The name of the property: e.g. 'foo'
      • getType

        public Class<?> getType()
        The property type: e.g. java.lang.String
      • getReadMethod

        public Method getReadMethod()
        The property getter method: e.g. getFoo()
      • getWriteMethod

        public Method getWriteMethod()
        The property setter method: e.g. setFoo(String)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class  Object