JType 0.1.1-redhat-2

com.googlecode.jtype
Class TypeUtils

java.lang.Object
  extended by com.googlecode.jtype.TypeUtils

public final class TypeUtils
extends Object

Provides utility methods for working with types.

Version:
$Id: TypeUtils.java 49 2009-10-07 17:10:57Z markhobson $
Author:
Mark Hobson

Method Summary
static Type getActualTypeArgument(Type type)
           
static Type getArrayType(Type componentType)
           
static Type getComponentType(Type type)
           
static Class<?> getErasedReferenceType(Type type)
           
static Type getErasedType(Type type)
          Gets the erased type of the specified type.
static Class<?> getRawType(Type type)
          Deprecated. Use getErasedReferenceType(Type) instead.
static Type[] getResolvedInterfaces(Type type)
           
static Type getResolvedSuperclass(Type type)
           
static boolean isArray(Type type)
           
static boolean isAssignable(Type supertype, Type type)
           
static boolean isInstance(Type type, Object object)
           
static boolean isSimpleParameterizedType(Type type, Class<?> rawType)
           
static String toSimpleString(Type type)
           
static String toString(Type type)
           
static String toString(Type type, ClassSerializer serializer)
           
static String toUnqualifiedString(Type type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isAssignable

public static boolean isAssignable(Type supertype,
                                   Type type)

isInstance

public static boolean isInstance(Type type,
                                 Object object)

getErasedType

public static Type getErasedType(Type type)
Gets the erased type of the specified type.

Parameters:
type - the type to perform erasure on
Returns:
the erased type, never a parameterized type nor a type variable
See Also:
4.6 Type Erasure

getErasedReferenceType

public static Class<?> getErasedReferenceType(Type type)

getRawType

@Deprecated
public static Class<?> getRawType(Type type)
Deprecated. Use getErasedReferenceType(Type) instead.


isArray

public static boolean isArray(Type type)

getComponentType

public static Type getComponentType(Type type)

getArrayType

public static Type getArrayType(Type componentType)

isSimpleParameterizedType

public static boolean isSimpleParameterizedType(Type type,
                                                Class<?> rawType)

getActualTypeArgument

public static Type getActualTypeArgument(Type type)

getResolvedSuperclass

public static Type getResolvedSuperclass(Type type)

getResolvedInterfaces

public static Type[] getResolvedInterfaces(Type type)

toString

public static String toString(Type type)

toString

public static String toString(Type type,
                              ClassSerializer serializer)

toUnqualifiedString

public static String toUnqualifiedString(Type type)

toSimpleString

public static String toSimpleString(Type type)

JType 0.1.1-redhat-2

Copyright © 2008-2012 JBoss by Red Hat. All Rights Reserved.