org.springframework.core.convert

Class Property

  • java.lang.Object
    • org.springframework.core.convert.Property


  • public final class Property
    extends java.lang.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 Summary

      Constructors 
      Constructor and Description
      Property(java.lang.Class<?> objectType, java.lang.reflect.Method readMethod, java.lang.reflect.Method writeMethod) 
      Property(java.lang.Class<?> objectType, java.lang.reflect.Method readMethod, java.lang.reflect.Method writeMethod, java.lang.String name) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object other) 
      java.lang.String getName()
      The name of the property: e.g.
      java.lang.Class<?> getObjectType()
      The object declaring this property, either directly or in a superclass the object extends.
      java.lang.reflect.Method getReadMethod()
      The property getter method: e.g.
      java.lang.Class<?> getType()
      The property type: e.g.
      java.lang.reflect.Method getWriteMethod()
      The property setter method: e.g.
      int hashCode() 
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Property

        public Property(java.lang.Class<?> objectType,
                        @Nullable
                        java.lang.reflect.Method readMethod,
                        @Nullable
                        java.lang.reflect.Method writeMethod)
      • Property

        public Property(java.lang.Class<?> objectType,
                        @Nullable
                        java.lang.reflect.Method readMethod,
                        @Nullable
                        java.lang.reflect.Method writeMethod,
                        @Nullable
                        java.lang.String name)
    • Method Detail

      • getObjectType

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

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

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

        @Nullable
        public java.lang.reflect.Method getReadMethod()
        The property getter method: e.g. getFoo()
      • getWriteMethod

        @Nullable
        public java.lang.reflect.Method getWriteMethod()
        The property setter method: e.g. setFoo(String)
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object