Class Pretty
- java.lang.Object
-
- org.glassfish.hk2.utilities.reflection.Pretty
-
public class Pretty extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCONSTRUCTOR_NAMEprivate static java.lang.StringDOTprivate static java.lang.StringNULL_STRING
-
Constructor Summary
Constructors Constructor Description Pretty()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringarray(java.lang.Object[] array)Returns a pretty string for the given arraystatic java.lang.Stringclazz(java.lang.Class<?> clazz)Makes a nice, pretty class (without the package name)static java.lang.Stringcollection(java.util.Collection<?> collection)Returns a pretty string representing the collectionstatic java.lang.Stringconstructor(java.lang.reflect.Constructor<?> constructor)Make a nice pretty string out of the constructor and all its parametersstatic java.lang.Stringfield(java.lang.reflect.Field field)Returns a pretty string representing a Fieldstatic java.lang.Stringmethod(java.lang.reflect.Method method)Makes a nice pretty string of the method, with the method name and all parametersprivate static java.lang.StringprettyPrintParameters(java.lang.Class<?>[] params)static java.lang.StringpType(java.lang.reflect.ParameterizedType pType)Prints a pretty parameterized typestatic java.lang.Stringtype(java.lang.reflect.Type t)Returns a pretty string for the given type
-
-
-
Field Detail
-
DOT
private static final java.lang.String DOT
- See Also:
- Constant Field Values
-
NULL_STRING
private static final java.lang.String NULL_STRING
- See Also:
- Constant Field Values
-
CONSTRUCTOR_NAME
private static final java.lang.String CONSTRUCTOR_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
clazz
public static java.lang.String clazz(java.lang.Class<?> clazz)
Makes a nice, pretty class (without the package name)- Parameters:
clazz- Make me a pretty class- Returns:
- A nice string of the class, with no package
-
pType
public static java.lang.String pType(java.lang.reflect.ParameterizedType pType)
Prints a pretty parameterized type- Parameters:
pType- The parameterized type to print. May not be null- Returns:
- A pretty string version of the parameterized type
-
type
public static java.lang.String type(java.lang.reflect.Type t)
Returns a pretty string for the given type- Parameters:
t- A possibly null type- Returns:
- A pretty string representing the type
-
constructor
public static java.lang.String constructor(java.lang.reflect.Constructor<?> constructor)
Make a nice pretty string out of the constructor and all its parameters- Parameters:
constructor- The constructor to make pretty- Returns:
- A nice pretty string
-
method
public static java.lang.String method(java.lang.reflect.Method method)
Makes a nice pretty string of the method, with the method name and all parameters- Parameters:
method- The method to make pretty- Returns:
- A nice pretty string
-
field
public static java.lang.String field(java.lang.reflect.Field field)
Returns a pretty string representing a Field- Parameters:
field- The possibly null field- Returns:
- A pretty string representing the field
-
array
public static java.lang.String array(java.lang.Object[] array)
Returns a pretty string for the given array- Parameters:
array- The possibly null array to represent- Returns:
- A pretty string representation of the array
-
collection
public static java.lang.String collection(java.util.Collection<?> collection)
Returns a pretty string representing the collection- Parameters:
collection- A possibly null collection to represent- Returns:
- A pretty string representing the collection
-
prettyPrintParameters
private static java.lang.String prettyPrintParameters(java.lang.Class<?>[] params)
-
-