org.springframework.util
Class TypeUtils

java.lang.Object
  extended by org.springframework.util.TypeUtils

public abstract class TypeUtils
extends java.lang.Object

Utility to work with Java 5 generic type parameters. Mainly for internal use within the framework.

Since:
2.0.7
Author:
Ramnivas Laddad, Juergen Hoeller, Chris Beams

Constructor Summary
TypeUtils()
           
 
Method Summary
private static boolean isAssignable(java.lang.reflect.ParameterizedType lhsType, java.lang.reflect.ParameterizedType rhsType)
           
static boolean isAssignable(java.lang.reflect.Type lhsType, java.lang.reflect.Type rhsType)
          Check if the right-hand side type may be assigned to the left-hand side type following the Java generics rules.
private static boolean isAssignable(java.lang.reflect.WildcardType lhsType, java.lang.reflect.Type rhsType)
           
static boolean isAssignableBound(java.lang.reflect.Type lhsType, java.lang.reflect.Type rhsType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeUtils

public TypeUtils()
Method Detail

isAssignable

public static boolean isAssignable(java.lang.reflect.Type lhsType,
                                   java.lang.reflect.Type rhsType)
Check if the right-hand side type may be assigned to the left-hand side type following the Java generics rules.

Parameters:
lhsType - the target type
rhsType - the value type that should be assigned to the target type
Returns:
true if rhs is assignable to lhs

isAssignable

private static boolean isAssignable(java.lang.reflect.ParameterizedType lhsType,
                                    java.lang.reflect.ParameterizedType rhsType)

isAssignable

private static boolean isAssignable(java.lang.reflect.WildcardType lhsType,
                                    java.lang.reflect.Type rhsType)

isAssignableBound

public static boolean isAssignableBound(java.lang.reflect.Type lhsType,
                                        java.lang.reflect.Type rhsType)