类 ResolvableType

java.lang.Object
cn.taketoday.core.ResolvableType
所有已实现的接口:
Serializable

public class ResolvableType extends Object implements Serializable
Encapsulates a Java Type, providing access to supertypes, interfaces, and generic parameters along with the ability to ultimately resolve to a Class.

ResolvableTypes may be obtained from fields, executable parameters, method returns or classes. Most methods on this class will themselves return ResolvableTypes, allowing easy navigation. For example:

 private HashMap<Integer, List<String>> myMap;

 public void example() {
     ResolvableType t = ResolvableType.fromField(getClass().getDeclaredField("myMap"));
     t.getSuperType(); // AbstractMap<Integer, List<String>>
     t.asMap(); // Map<Integer, List<String>>
     t.getGeneric(0).resolve(); // Integer
     t.getGeneric(1).resolve(); // List
     t.getGeneric(1); // List<String>
     t.resolveGeneric(1, 0); // String
 }
 

From Spring

从以下版本开始:
3.0
作者:
Phillip Webb, Juergen Hoeller, Stephane Nicoll
另请参阅:
  • 字段详细资料

    • NONE

      public static final ResolvableType NONE
      ResolvableType returned when no value is available. NONE is used in preference to null so that multiple method calls can be safely chained.
    • EMPTY_TYPES_ARRAY

      public static final ResolvableType[] EMPTY_TYPES_ARRAY
  • 方法详细资料