Class TypeResolver

  • All Implemented Interfaces:
    java.io.Serializable

    public class TypeResolver
    extends java.lang.Object
    implements java.io.Serializable
    Object that is used for resolving generic type information of a class so that it is accessible using simple API. Resolved types are also starting point for accessing resolved (generics aware) return and argument types of class members (methods, fields, constructors).

    Note that resolver instances are stateful in that resolvers cache resolved types for efficiency. Since this is internal state and not directly visible to callers, access to state is fully synchronized so that access from multiple threads is safe.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeResolver()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object readResolve()  
      ResolvedType resolve​(TypeBindings typeBindings, java.lang.reflect.Type jdkType)
      Factory method for resolving specified Java Type, given TypeBindings needed to resolve any type variables.
      • Methods inherited from class java.lang.Object

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

      • TypeResolver

        public TypeResolver()
    • Method Detail

      • readResolve

        protected java.lang.Object readResolve()
      • resolve

        public ResolvedType resolve​(TypeBindings typeBindings,
                                    java.lang.reflect.Type jdkType)
        Factory method for resolving specified Java Type, given TypeBindings needed to resolve any type variables.

        Use of this method is discouraged (use if and only if you really know what you are doing!); but if used, type bindings passed should come from ResolvedType instance of declaring class (or interface).