public class ClassWrapper
extends Object
implements Serializable, AnnotatedElement, GenericDeclaration, Type
| Modifier and Type | Field and Description |
|---|---|
protected static Map<Class<?>,ClassWrapper> |
classMap |
protected Class<?> |
clazz |
protected String |
fqnClassname |
protected static Map<String,ClassWrapper> |
fqnMap |
protected Type[] |
genericInterfaces |
protected Type |
genericSuperClass |
protected Type[] |
interfaces |
protected ParameterizedType[] |
parameterizedTypes |
protected Type |
superClass |
protected TypeVariable<?>[] |
typeParameters |
| Modifier | Constructor and Description |
|---|---|
protected |
ClassWrapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTypeVariable(String name,
Type... bounds)
Adds a type variable.
|
static ClassWrapper |
anonymousOverride(Class<?> superClass)
Return a ClassWrapper overriding superClass.
|
ParameterizedType |
createParameterizedType(Type... actualTypeArguments) |
static ClassWrapper |
fromFullyQualifiedForm(String fullyQualifiedForm) |
static ClassWrapper |
fromFullyQualifiedForm(String fullyQualifiedForm,
Type superClass,
Type... interfaces) |
static ClassWrapper |
fromInternalForm(String internalForm) |
static ClassWrapper |
fromInternalForm(String internalForm,
Type superClass,
Type... interfaces) |
<T extends Annotation> |
getAnnotation(Class<T> annotationClass) |
Annotation[] |
getAnnotations() |
Annotation[] |
getDeclaredAnnotations() |
String |
getFullyQualifiedForm()
Returns fully qualified form Eg.
|
static String |
getFullyQualifiedForm(String internalForm) |
Type[] |
getGenericInterfaces() |
Type |
getGenericSuperclass() |
Type[] |
getInterfaces() |
static String |
getInternalForm(String fullyQualifiedname) |
int |
getModifiers() |
String |
getName() |
static ClassWrapper[] |
getParameters(Class<?>... params) |
static ClassWrapper[] |
getParameters(Constructor constructor) |
static ClassWrapper[] |
getParameters(Method method) |
static ClassWrapper |
getReturnType(Method method) |
String |
getSimpleName() |
Type |
getSuperclass() |
static Type |
getType(String internalForm) |
TypeVariable<?>[] |
getTypeParameters() |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass) |
boolean |
isInterface() |
static String |
makeClassname(String packageName,
String candidate) |
String |
toString() |
static ClassWrapper |
wrap(String fullyQualifiedForm,
Type superClass,
Type... interfaces)
Wraps a not existing class.
|
static ClassWrapper |
wrap(String fullyQualifiedForm,
TypeVariable[] typeParameters,
Type superClass,
Type... interfaces) |
boolean |
wraps(Class<?> cls) |
protected static Map<Class<?>,ClassWrapper> classMap
protected static Map<String,ClassWrapper> fqnMap
protected Class<?> clazz
protected String fqnClassname
protected Type superClass
protected Type[] interfaces
protected TypeVariable<?>[] typeParameters
protected ParameterizedType[] parameterizedTypes
protected Type genericSuperClass
protected Type[] genericInterfaces
public static ClassWrapper wrap(String fullyQualifiedForm, Type superClass, Type... interfaces)
fullyQualifiedForm - public static ClassWrapper wrap(String fullyQualifiedForm, TypeVariable[] typeParameters, Type superClass, Type... interfaces)
public static ClassWrapper anonymousOverride(Class<?> superClass)
superClass - public void addTypeVariable(String name,
Type... bounds)
public ParameterizedType createParameterizedType(Type... actualTypeArguments)
public Type[] getInterfaces()
public static ClassWrapper fromInternalForm(String internalForm)
public static ClassWrapper fromFullyQualifiedForm(String fullyQualifiedForm)
public static ClassWrapper fromInternalForm(String internalForm, Type superClass, Type... interfaces)
public static ClassWrapper fromFullyQualifiedForm(String fullyQualifiedForm, Type superClass, Type... interfaces)
public static Type getType(String internalForm)
public static String getFullyQualifiedForm(String internalForm)
public static ClassWrapper[] getParameters(Constructor constructor)
public static ClassWrapper[] getParameters(Method method)
public static ClassWrapper getReturnType(Method method)
public static ClassWrapper[] getParameters(Class<?>... params)
public String getFullyQualifiedForm()
public String toString()
toString in class Objectpublic String getName()
public boolean wraps(Class<?> cls)
public static String makeClassname(String packageName,
String candidate)
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
isAnnotationPresent in interface AnnotatedElementpublic <T extends Annotation> T getAnnotation(Class<T> annotationClass)
getAnnotation in interface AnnotatedElementpublic Annotation[] getAnnotations()
getAnnotations in interface AnnotatedElementpublic Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations in interface AnnotatedElementpublic TypeVariable<?>[] getTypeParameters()
getTypeParameters in interface GenericDeclarationpublic Type getGenericSuperclass()
public Type[] getGenericInterfaces()
public boolean isInterface()
public Type getSuperclass()
public static String getInternalForm(String fullyQualifiedname)
public int getModifiers()
public String getSimpleName()