public class BytecodeTypeInfo extends BytecodeInheritableAnnotationHolder implements ClassInfo, InterfaceInfo
| Modifier and Type | Class and Description |
|---|---|
static class |
BytecodeTypeInfo.MarshalledClassInfo |
| Modifier and Type | Field and Description |
|---|---|
protected Class<? extends Object> |
clazz
The class
|
protected static RuntimePermission |
GET_CLASSLOADER_PERMISSION
The get classloader permission
|
allAnnotations, allAnnotationsArray, classBytes, initializedannotationHelper, annotationMap, annotationsArrayABSTRACT, CONSTANT, FINAL, PACKAGE, PACKAGE_ABSTRACT, PACKAGE_CONSTANT, PACKAGE_STATIC, PRIVATE, PRIVATE_CONSTANT, PRIVATE_STATIC, PROTECTED, PROTECTED_ABSTRACT, PROTECTED_CONSTANT, PROTECTED_STATIC, PUBLIC, PUBLIC_ABSTRACT, PUBLIC_CONSTANT, PUBLIC_STATIC, STATIC| Modifier and Type | Method and Description |
|---|---|
Object |
convertValue(Object value)
Convert a value
|
Object |
convertValue(Object value,
boolean replaceProperties)
Convert a value
|
Object |
convertValue(Object value,
boolean replaceProperties,
boolean trim)
Convert a value
|
boolean |
equals(Object obj) |
protected ConstructorInfo |
generateConstructorInfo(ConstructorBytes constructor)
Generate constructor info
|
protected ConstructorInfo |
generateConstructorInfo(SignatureKey key)
Generate constructor info
|
protected FieldInfo |
generateFieldInfo(FieldBytes field)
Generate field info
|
protected MethodInfo |
generateMethodInfo(MethodBytes method)
Generate method info
|
protected MethodInfo |
generateMethodInfo(SignatureKey key)
Generate method info
|
TypeInfo[] |
getActualTypeArguments()
Get the actual type parameters
|
AnnotationValue[] |
getAnnotations()
Get the annotations
|
static Class<?> |
getArrayClass(Class<?> clazz)
Get an array class
|
TypeInfo |
getArrayType()
Get an array type
|
<T> T |
getAttachment(Class<T> expectedType)
Get an attachment from the type,
uses the expected type as both the name
and to cast the resulting object.
|
Object |
getAttachment(String attachmentName)
Get an attachment from the type
|
ClassBytes |
getClassBytes() |
ClassLoader |
getClassLoader()
Get the classloader for this class info.
|
ClassLoader |
getClassLoaderInternal() |
javassist.bytecode.SignatureAttribute.ClassSignature |
getClassSignature() |
TypeInfo |
getComponentType()
Get the component type if it is a collection or an array
|
ConstructorInfo |
getDeclaredConstructor() |
ConstructorInfo |
getDeclaredConstructor(String... parameters) |
ConstructorInfo |
getDeclaredConstructor(TypeInfo... parameters)
Get a declared constructor
|
ConstructorInfo[] |
getDeclaredConstructors()
Get the declared constructors
|
FieldInfo |
getDeclaredField(String fieldName)
Get the declared field
|
FieldInfo[] |
getDeclaredFields()
Get the declared fields
|
MethodInfo |
getDeclaredMethod(String methodName) |
MethodInfo |
getDeclaredMethod(String methodName,
String... parameters) |
MethodInfo |
getDeclaredMethod(String methodName,
TypeInfo... parameters)
Get the declared method
|
MethodInfo[] |
getDeclaredMethods()
Get the declared methods
|
BytecodeTypeInfoFactoryImpl |
getFactory()
Get the factory
|
InterfaceInfo[] |
getGenericInterfaces()
Get the generic interfaces
|
ClassInfo |
getGenericSuperclass()
Get the generic super class
|
protected int |
getHashCode() |
InterfaceInfo[] |
getInterfaces()
Get the interfaces
|
TypeInfo |
getKeyType()
Get the key type if it is a map
|
int |
getModifiers()
Get the modifiers
|
String |
getName()
Get the class name
|
TypeInfo |
getOwnerType()
Get the owner type
|
PackageInfo |
getPackage()
Get the package
|
protected String |
getPackageName() |
protected String |
getPackageName(String classname) |
ClassInfo |
getRawType()
Get the raw type
|
String |
getSimpleName()
Get the simple name
|
ClassInfo |
getSuperclass()
Get the super class
|
ClassInfo |
getSuperHolder() |
Class<? extends Object> |
getType()
Deprecated.
|
TypeInfoFactory |
getTypeInfoFactory()
Get the TypeInfoFactory that created this type info
|
String |
getTypeVariable()
Gets the type variable if we are a parameterized type which is part of a
parameterized type and there is a type variable for this type.
|
TypeInfo |
getValueType()
Get the value type if it is a map
|
boolean |
isAnnotation()
Whether this type is an annotation
|
boolean |
isArray()
Whether this type is an array
|
boolean |
isAssignableFrom(TypeInfo info)
Mostly using
|
boolean |
isCollection()
Whether this type is a collection
|
boolean |
isEnum()
Whether this type is an enum
|
boolean |
isInstance(Object object)
Is object instance of this type info.
|
boolean |
isInterface()
Whether it is an interface
|
boolean |
isMap()
Whether this type is a map
|
boolean |
isPrimitive()
Whether this type is a primitive
|
boolean |
isPublic() |
boolean |
isStatic()
Whether it is static
|
boolean |
isVolatile()
Whether it is volatile
|
Object |
newArrayInstance(int size)
Create a new array
|
void |
setAttachment(String name,
Object attachment)
Set an attachment against the type.
|
void |
toShortString(org.jboss.util.JBossStringBuilder buffer) |
protected void |
toString(org.jboss.util.JBossStringBuilder buffer) |
protected Object |
writeReplace() |
getAllAnnotations, getAnnotation, getAnnotations, isAnnotationPresent, setupAnnotationsgetUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresentcacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, hashCode, list, notEqual, toShortString, toString, toStringImplementationfinalize, getClass, notify, notifyAll, wait, wait, waitgetAnnotation, getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent, isAnnotationPresentprotected static final RuntimePermission GET_CLASSLOADER_PERMISSION
public boolean isInterface()
ClassInfoisInterface in interface ClassInfopublic String getSimpleName()
TypeInfogetSimpleName in interface TypeInfopublic int getModifiers()
ModifierInfogetModifiers in interface ModifierInfopublic boolean isPublic()
isPublic in interface ModifierInfopublic boolean isStatic()
ModifierInfoisStatic in interface ModifierInfopublic boolean isVolatile()
ModifierInfoisVolatile in interface ModifierInfo@Deprecated public Class<? extends Object> getType()
TypeInfopublic ClassLoader getClassLoader()
TypeInfogetClassLoader in interface TypeInfopublic ClassLoader getClassLoaderInternal()
public ClassInfo getSuperclass()
ClassInfogetSuperclass in interface ClassInfopublic ClassInfo getGenericSuperclass()
ClassInfogetGenericSuperclass in interface ClassInfopublic InterfaceInfo[] getInterfaces()
ClassInfogetInterfaces in interface ClassInfopublic InterfaceInfo[] getGenericInterfaces()
ClassInfogetGenericInterfaces in interface ClassInfopublic ConstructorInfo[] getDeclaredConstructors()
ClassInfogetDeclaredConstructors in interface ClassInfopublic ConstructorInfo getDeclaredConstructor()
public ConstructorInfo getDeclaredConstructor(String... parameters) throws ClassNotFoundException
ClassNotFoundExceptionpublic ConstructorInfo getDeclaredConstructor(TypeInfo... parameters)
ClassInfogetDeclaredConstructor in interface ClassInfoparameters - the parameterspublic FieldInfo getDeclaredField(String fieldName)
ClassInfogetDeclaredField in interface ClassInfofieldName - the field namepublic FieldInfo[] getDeclaredFields()
ClassInfogetDeclaredFields in interface ClassInfopublic MethodInfo getDeclaredMethod(String methodName)
public MethodInfo getDeclaredMethod(String methodName, TypeInfo... parameters)
ClassInfogetDeclaredMethod in interface ClassInfomethodName - the method nameparameters - the parameterspublic MethodInfo getDeclaredMethod(String methodName, String... parameters) throws ClassNotFoundException
ClassNotFoundExceptionpublic MethodInfo[] getDeclaredMethods()
ClassInfogetDeclaredMethods in interface ClassInfopublic boolean isArray()
TypeInfopublic boolean isCollection()
TypeInfoisCollection in interface TypeInfopublic boolean isMap()
TypeInfopublic boolean isAnnotation()
TypeInfoisAnnotation in interface TypeInfopublic boolean isEnum()
TypeInfopublic boolean isPrimitive()
TypeInfoisPrimitive in interface TypeInfopublic static Class<?> getArrayClass(Class<?> clazz)
clazz - the classpublic TypeInfo getArrayType()
TypeInfogetArrayType in interface TypeInfopublic Object newArrayInstance(int size) throws Throwable
TypeInfonewArrayInstance in interface TypeInfosize - the sizeThrowable - for any errorpublic boolean isAssignableFrom(TypeInfo info)
TypeInfoisAssignableFrom in interface TypeInfoinfo - type infoPrimitiveInfo tests for progressionpublic boolean isInstance(Object object)
TypeInfoisInstance in interface TypeInfoobject - the object to checkobject is an instance of this classPrimitiveInfo tests for progressionpublic TypeInfoFactory getTypeInfoFactory()
TypeInfogetTypeInfoFactory in interface TypeInfopublic Object convertValue(Object value) throws Throwable
TypeInfoconvertValue in interface TypeInfovalue - the original valueThrowable - for any errorpublic Object convertValue(Object value, boolean replaceProperties) throws Throwable
TypeInfoconvertValue in interface TypeInfovalue - the original valuereplaceProperties - whether to replace propertiesThrowable - for any errorpublic Object convertValue(Object value, boolean replaceProperties, boolean trim) throws Throwable
TypeInfoconvertValue in interface TypeInfovalue - the original valuereplaceProperties - whether to replace propertiestrim - do we trim before conversionThrowable - for any errorprotected int getHashCode()
getHashCode in class org.jboss.util.JBossObjectpublic void toShortString(org.jboss.util.JBossStringBuilder buffer)
toShortString in interface org.jboss.util.JBossInterfacetoShortString in class org.jboss.util.JBossObjectprotected void toString(org.jboss.util.JBossStringBuilder buffer)
toString in class org.jboss.util.JBossObjectpublic BytecodeTypeInfoFactoryImpl getFactory()
protected ConstructorInfo generateConstructorInfo(ConstructorBytes constructor)
constructor - the constructorprotected ConstructorInfo generateConstructorInfo(SignatureKey key)
key - the keyprotected FieldInfo generateFieldInfo(FieldBytes field)
field - the fieldprotected MethodInfo generateMethodInfo(SignatureKey key)
key - the keyprotected MethodInfo generateMethodInfo(MethodBytes method)
method - the methodpublic AnnotationValue[] getAnnotations()
AnnotatedInfogetAnnotations in interface AnnotatedInfogetAnnotations in class BytecodeInheritableAnnotationHolderpublic ClassInfo getSuperHolder()
getSuperHolder in class BytecodeInheritableAnnotationHolderpublic TypeInfo[] getActualTypeArguments()
ClassInfogetActualTypeArguments in interface ClassInfopublic TypeInfo getOwnerType()
ClassInfogetOwnerType in interface ClassInfopublic ClassInfo getRawType()
ClassInfogetRawType in interface ClassInfopublic TypeInfo getComponentType()
ClassInfogetComponentType in interface ClassInfopublic TypeInfo getKeyType()
ClassInfogetKeyType in interface ClassInfopublic TypeInfo getValueType()
ClassInfogetValueType in interface ClassInfopublic PackageInfo getPackage()
ClassInfogetPackage in interface ClassInfoprotected String getPackageName()
public void setAttachment(String name, Object attachment)
TypeInfoIf you add a future object, subsequent gets will wait for the result
WARNING: Be careful about what you put in here. Don't create references across classloaders, if you are not sure add a WeakReference to the information.
setAttachment in interface TypeInfoname - the nameattachment - the attachment, pass null to remove an attachmentpublic <T> T getAttachment(Class<T> expectedType)
TypeInfogetAttachment in interface TypeInfoT - the expected typeexpectedType - the expected typepublic Object getAttachment(String attachmentName)
TypeInfogetAttachment in interface TypeInfoattachmentName - the nameprotected Object writeReplace()
public String getTypeVariable()
ClassInfogetTypeVariable in interface ClassInfopublic javassist.bytecode.SignatureAttribute.ClassSignature getClassSignature()
public ClassBytes getClassBytes()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.