Package libcore.reflect
Class Types
- java.lang.Object
-
- libcore.reflect.Types
-
public final class Types extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidappendArrayGenericType(StringBuilder out, Type[] types)Appends names of thetypestooutseparated by commas.static voidappendGenericType(StringBuilder out, Type type)static voidappendTypeName(StringBuilder out, Class<?> c)static StringgetSignature(Class<?> clazz)Returns the internal name ofclazz(also known as the descriptor).static TypegetType(Type type)static Type[]getTypeArray(ListOfTypes types, boolean clone)static StringtoString(Class<?>[] types)Returns the names oftypesseparated by commas.
-
-
-
Method Detail
-
getTypeArray
public static Type[] getTypeArray(ListOfTypes types, boolean clone)
-
getSignature
public static String getSignature(Class<?> clazz)
Returns the internal name ofclazz(also known as the descriptor).
-
toString
public static String toString(Class<?>[] types)
Returns the names oftypesseparated by commas.
-
appendTypeName
public static void appendTypeName(StringBuilder out, Class<?> c)
Appends the besttoString(java.lang.Class<?>[])name forctoout. This works around the fact thatClass.getName()is lousy for primitive arrays (it writes "[C" instead of "char[]") andClass.getCanonicalName()is lousy for nested classes (it uses a "." separator rather than a "$" separator).
-
appendArrayGenericType
public static void appendArrayGenericType(StringBuilder out, Type[] types)
Appends names of thetypestooutseparated by commas.
-
appendGenericType
public static void appendGenericType(StringBuilder out, Type type)
-
-