类 Property

java.lang.Object
cn.taketoday.reflect.Property
所有已实现的接口:
Serializable, AnnotatedElement, Member

public class Property extends Object implements Member, AnnotatedElement, Serializable
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 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.

从以下版本开始:
4.0 2022/7/23 01:01
作者:
Harry Yang
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • annotationCache

      private static final ConcurrentReferenceHashMap<Property,Annotation[]> annotationCache
    • field

      protected transient Field field
    • typeDescriptor

      @Nullable private transient TypeDescriptor typeDescriptor
      从以下版本开始:
      3.0.4
    • name

      protected final String name
    • readMethod

      @Nullable protected final Method readMethod
      从以下版本开始:
      4.0
    • writeMethod

      @Nullable protected final Method writeMethod
      从以下版本开始:
      4.0
    • propertyType

      private Class<?> propertyType
      从以下版本开始:
      4.0
    • declaringClass

      private Class<?> declaringClass
      从以下版本开始:
      4.0
    • fieldIsNull

      private boolean fieldIsNull
      从以下版本开始:
      4.0
    • annotations

      @Nullable private transient Annotation[] annotations
    • resolvableType

      private ResolvableType resolvableType
    • methodParameter

      private transient MethodParameter methodParameter
    • writeMethodParameter

      protected transient MethodParameter writeMethodParameter
  • 构造器详细资料

  • 方法详细资料

    • getTypeDescriptor

      public final TypeDescriptor getTypeDescriptor()
      Returns TypeDescriptor for this property
      从以下版本开始:
      3.0.4
    • createDescriptor

      protected TypeDescriptor createDescriptor()
    • getResolvableType

      public ResolvableType getResolvableType()
    • createResolvableType

      protected ResolvableType createResolvableType()
    • isInstance

      public boolean isInstance(Object value)
      Determines if the specified Object is assignment-compatible with the object represented by this Property. This method is the dynamic equivalent of the Java language instanceof operator. The method returns true if the specified Object argument is non-null and can be cast to the reference type represented by this Property object without raising a ClassCastException. It returns false otherwise.

      Specifically, if this Property object represents a declared class, this method returns true if the specified Object argument is an instance of the represented class (or of any of its subclasses); it returns false otherwise. If this Property object represents an array class, this method returns true if the specified Object argument can be converted to an object of the array class by an identity conversion or by a widening reference conversion; it returns false otherwise. If this Property object represents an interface, this method returns true if the class or any superclass of the specified Object argument implements this interface; it returns false otherwise. If this Property object represents a primitive type, this method returns false.

      参数:
      value - the object to check
      返回:
      true if obj is an instance of this property-type
      另请参阅:
    • getType

      public Class<?> getType()
      Returns a Class object that identifies the declared type for the field represented by this Field object.
      返回:
      a Class object identifying the declared type of the field represented by this object
    • getField

      @Nullable public Field getField()
      get or find a Field
      返回:
      returns null show that isSynthetic
    • getName

      public String getName()
      original property name
      指定者:
      getName 在接口中 Member
    • getModifiers

      public int getModifiers()
      指定者:
      getModifiers 在接口中 Member
    • isSynthetic

      public boolean isSynthetic()
      指定者:
      isSynthetic 在接口中 Member
    • isReadOnly

      public boolean isReadOnly()
      read only
      从以下版本开始:
      3.0.2
    • isWriteable

      public boolean isWriteable()
      can write
      从以下版本开始:
      4.0
    • isReadable

      public boolean isReadable()
      can read
      从以下版本开始:
      4.0
    • isPrimitive

      public boolean isPrimitive()
      is primitive
      从以下版本开始:
      4.0
      另请参阅:
    • getDeclaringClass

      public Class<?> getDeclaringClass()
      Returns the Class object representing the class or interface that declares the field represented by this Field object.
      指定者:
      getDeclaringClass 在接口中 Member
      从以下版本开始:
      4.0
    • getReadMethod

      @Nullable public Method getReadMethod()
    • getWriteMethod

      @Nullable public Method getWriteMethod()
    • getWriteMethodParameter

      @Nullable public MethodParameter getWriteMethodParameter()
    • getMethodParameter

      public MethodParameter getMethodParameter()
      If method based bean-property
    • resolveMethodParameter

      private MethodParameter resolveMethodParameter()
    • resolveReadMethodParameter

      @Nullable private MethodParameter resolveReadMethodParameter()
    • isAnnotationPresent

      public boolean isAnnotationPresent(@NonNull Class<? extends Annotation> annotationClass)
      指定者:
      isAnnotationPresent 在接口中 AnnotatedElement
    • getAnnotation

      @Nullable public <T extends Annotation> T getAnnotation(@NonNull Class<T> annotationClass)
      指定者:
      getAnnotation 在接口中 AnnotatedElement
    • getDeclaredAnnotations

      public Annotation[] getDeclaredAnnotations()
      指定者:
      getDeclaredAnnotations 在接口中 AnnotatedElement
    • getAnnotations

      public Annotation[] getAnnotations()
      指定者:
      getAnnotations 在接口中 AnnotatedElement
    • resolveAnnotations

      private Annotation[] resolveAnnotations()
    • addAnnotationsToMap

      private void addAnnotationsToMap(Map<Class<? extends Annotation>,Annotation> annotationMap, @Nullable AnnotatedElement object)
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object