Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.util.generics
Class GenericTypeResolver

    java.lang.Object
      org.mule.util.generics.GenericTypeResolver

    public abstract class GenericTypeResolver

extends Object

Helper class for resolving generic types against type variables.

Mainly intended for usage within the framework, resolving method parameter types even when they are declared generically.

author: Spring

Method Summary
`static Type` | `getTargetType(MethodParameter methodParam)` Determine the target type for the given parameter specification.
`static Class<?>` | `resolveParameterType(MethodParameter methodParam, Class clazz)` Determine the target type for the given generic parameter type.
`static Class<?>` | `resolveReturnType(Method method, Class clazz)` Determine the target type for the generic return type of the given method.
`static Class<?>` | `resolveTypeArgument(Class clazz, Class genericIfc)` Resolve the single type argument of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare a concrete type for its type variable.
`static Class[]` | `resolveTypeArguments(Class clazz, Class genericIfc)` Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getTargetType

    public static Type getTargetType(MethodParameter methodParam)

  Determine the target type for the given parameter specification.

  Parameters:
    `methodParam` - the method parameter specification
  Returns:
    the corresponding generic parameter type

### resolveParameterType

    public static Class<?> resolveParameterType(MethodParameter methodParam,
                                                Class clazz)

  Determine the target type for the given generic parameter type.

  Parameters:
    `methodParam` - the method parameter specification
    `clazz` - the class to resolve type variables against
  Returns:
    the corresponding generic parameter or return type

### resolveReturnType

    public static Class<?> resolveReturnType(Method method,
                                             Class clazz)

  Determine the target type for the generic return type of the given method.

  Parameters:
    `method` - the method to introspect
    `clazz` - the class to resolve type variables against
  Returns:
    the corresponding generic parameter or return type

### resolveTypeArgument

    public static Class<?> resolveTypeArgument(Class clazz,
                                               Class genericIfc)

  Resolve the single type argument of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare a concrete type for its type variable.

  Parameters:
    `clazz` - the target class to check against
    `genericIfc` - the generic interface to resolve the type argument from
  Returns:
    the resolved type of the argument, or `null` if not resolvable

### resolveTypeArguments

    public static Class[] resolveTypeArguments(Class clazz,
                                               Class genericIfc)

  Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables.

  Parameters:
    `clazz` - the target class to check against
    `genericIfc` - the generic interface to resolve the type argument from
  Returns:
    the resolved type of each argument, with the array size matching the number of actual type arguments, or `null` if not resolvable

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.