Top Fields Constructors Methods
org.glassfish.hk2.utilities.reflection

public Class Pretty

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .Field, .Method, .ParameterizedType, .Type, java.util.Collection

Author
jwells

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

A pretty string representation of the array
array
(Object[]
The possibly null array to represent
array
)

Returns a pretty string for the given array

public static String

Returns:

A nice string of the class, with no package
clazz
(Class<?>
Make me a pretty class
clazz
)

Makes a nice, pretty class (without the package name)

public static String

Returns:

A pretty string representing the collection
collection
(Collection<?>
A possibly null collection to represent
collection
)

Returns a pretty string representing the collection

public static String

Returns:

A nice pretty string
constructor
(Constructor<?>
The constructor to make pretty
constructor
)

Make a nice pretty string out of the constructor and all its parameters

public static String

Returns:

A pretty string representing the field
field
(Field
The possibly null field
field
)

Returns a pretty string representing a Field

public static String

Returns:

A nice pretty string
method
(Method
The method to make pretty
method
)

Makes a nice pretty string of the method, with the method name and all parameters

private static String
public static String

Returns:

A pretty string version of the parameterized type
pType
(ParameterizedType
The parameterized type to print. May not be null
pType
)

Prints a pretty parameterized type

public static String

Returns:

A pretty string representing the type
type
(Type
A possibly null type
t
)

Returns a pretty string for the given type

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONSTRUCTOR_NAMEback to summary
private static final String CONSTRUCTOR_NAME
DOTback to summary
private static final String DOT
NULL_STRINGback to summary
private static final String NULL_STRING

Constructor Detail

Prettyback to summary
public Pretty()

Method Detail

arrayback to summary
public static String array(Object[] array)

Returns a pretty string for the given array

Parameters
array:Object[]

The possibly null array to represent

Returns:String

A pretty string representation of the array

clazzback to summary
public static String clazz(Class<?> clazz)

Makes a nice, pretty class (without the package name)

Parameters
clazz:Class<?>

Make me a pretty class

Returns:String

A nice string of the class, with no package

collectionback to summary
public static String collection(Collection<?> collection)

Returns a pretty string representing the collection

Parameters
collection:Collection<?>

A possibly null collection to represent

Returns:String

A pretty string representing the collection

constructorback to summary
public static String constructor(Constructor<?> constructor)

Make a nice pretty string out of the constructor and all its parameters

Parameters
constructor:Constructor<?>

The constructor to make pretty

Returns:String

A nice pretty string

fieldback to summary
public static String field(Field field)

Returns a pretty string representing a Field

Parameters
field:Field

The possibly null field

Returns:String

A pretty string representing the field

methodback to summary
public static String method(Method method)

Makes a nice pretty string of the method, with the method name and all parameters

Parameters
method:Method

The method to make pretty

Returns:String

A nice pretty string

prettyPrintParametersback to summary
private static String prettyPrintParameters(Class<?>[] params)
pTypeback to summary
public static String pType(ParameterizedType pType)

Prints a pretty parameterized type

Parameters
pType:ParameterizedType

The parameterized type to print. May not be null

Returns:String

A pretty string version of the parameterized type

typeback to summary
public static String type(Type t)

Returns a pretty string for the given type

Parameters
t:Type

A possibly null type

Returns:String

A pretty string representing the type