|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.aspectwerkz.reflect.impl.asm.AsmClassInfo
public class AsmClassInfo
Implementation of the ClassInfo interface utilizing the ASM bytecode library for the info retriaval.
Annotations are lazily gathered, unless required to visit them at the same time as we visit methods and fields. This implementation guarantees that the method, fields and constructors can be retrieved in the same order as they were in the bytecode (it can depends of the compiler and might not be the order of the source code - f.e. IBM compiler)
Nested Class Summary | |
---|---|
static class |
AsmClassInfo.ClassNameRetrievalClassAdapter
ASM bytecode visitor that retrieves the class name from the bytecode. |
Nested classes/interfaces inherited from interface org.codehaus.aspectwerkz.reflect.ClassInfo |
---|
ClassInfo.NullClassInfo |
Field Summary | |
---|---|
protected static List |
EMPTY_LIST
|
protected static String[] |
EMPTY_STRING_ARRAY
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
List |
getAnnotations()
Returns the annotations infos. |
static ClassInfo |
getArrayClassInfo(String className,
ClassLoader loader,
ClassInfo componentClassInfo)
Create a ClassInfo based on a component type which can be himself an array |
static ClassInfo |
getClassInfo(byte[] bytecode,
ClassLoader loader)
Returns the class info for a specific class. |
static ClassInfo |
getClassInfo(InputStream stream,
ClassLoader loader)
Returns the class info for a specific class. |
static ClassInfo |
getClassInfo(InputStream stream,
ClassLoader loader,
boolean lazyAttributes)
Returns the class info for a specific class. |
static ClassInfo |
getClassInfo(String className,
ClassLoader loader)
Returns the class info for a specific class. |
ClassLoader |
getClassLoader()
Returns the class loader that loaded this class. |
ClassInfo |
getComponentType()
Returns the component type if array type else null. |
ConstructorInfo |
getConstructor(int hash)
Returns a constructor info by its hash. |
ConstructorInfo[] |
getConstructors()
Returns a list with all the constructors info. |
FieldInfo |
getField(int hash)
Returns a field info by its hash. |
FieldInfo[] |
getFields()
Returns a list with all the field info. |
ClassInfo[] |
getInterfaces()
Returns the interfaces. |
MethodInfo |
getMethod(int hash)
Returns a method info by its hash. |
MethodInfo[] |
getMethods()
Returns a list with all the methods info. |
int |
getModifiers()
Returns the class modifiers. |
String |
getName()
Returns the name of the class. |
static Class |
getPrimitiveClass(String className)
Checks if the class is a of a primitive type, if so create and return the class for the type else return null. |
String |
getSignature()
Returns the signature for the class. |
ClassInfo |
getSuperclass()
Returns the super class. |
int |
hashCode()
|
boolean |
hasStaticInitializer()
Checks if the class has a static initalizer. |
boolean |
isArray()
Is the class an array type. |
boolean |
isInterface()
Is the class an interface. |
boolean |
isPrimitive()
Is the class a primitive type. |
static void |
markDirty(String className,
ClassLoader loader)
Marks the class as dirty (since it has been modified and needs to be rebuild). |
static ClassInfo |
newClassInfo(byte[] bytecode,
ClassLoader loader)
Returns a completely new class info for a specific class. |
static String |
retrieveClassNameFromBytecode(byte[] bytecode)
Retrieves the class name from the bytecode of a class. |
StaticInitializationInfo |
staticInitializer()
Return the static initializer info or null if not present |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final String[] EMPTY_STRING_ARRAY
protected static final List EMPTY_LIST
Method Detail |
---|
public static ClassInfo newClassInfo(byte[] bytecode, ClassLoader loader)
bytecode
- loader
-
public static ClassInfo getClassInfo(String className, ClassLoader loader)
className
- loader
-
public static ClassInfo getClassInfo(byte[] bytecode, ClassLoader loader)
bytecode
- loader
-
public static ClassInfo getClassInfo(InputStream stream, ClassLoader loader)
stream
- loader
-
public static ClassInfo getClassInfo(InputStream stream, ClassLoader loader, boolean lazyAttributes)
stream
- loader
- lazyAttributes
-
public static void markDirty(String className, ClassLoader loader)
className
- public static String retrieveClassNameFromBytecode(byte[] bytecode)
bytecode
-
public static Class getPrimitiveClass(String className)
className
-
public List getAnnotations()
getAnnotations
in interface ReflectionInfo
public String getName()
getName
in interface ReflectionInfo
public String getSignature()
getSignature
in interface ReflectionInfo
public int getModifiers()
getModifiers
in interface ReflectionInfo
public ClassLoader getClassLoader()
getClassLoader
in interface ClassInfo
public boolean hasStaticInitializer()
hasStaticInitializer
in interface ClassInfo
public StaticInitializationInfo staticInitializer()
staticInitializer
in interface ClassInfo
ClassInfo.staticInitializer()
public ConstructorInfo getConstructor(int hash)
getConstructor
in interface ClassInfo
hash
-
public ConstructorInfo[] getConstructors()
getConstructors
in interface ClassInfo
public MethodInfo getMethod(int hash)
getMethod
in interface ClassInfo
hash
-
public MethodInfo[] getMethods()
getMethods
in interface ClassInfo
public FieldInfo getField(int hash)
getField
in interface ClassInfo
hash
-
public FieldInfo[] getFields()
getFields
in interface ClassInfo
public ClassInfo[] getInterfaces()
getInterfaces
in interface ClassInfo
public ClassInfo getSuperclass()
getSuperclass
in interface ClassInfo
public ClassInfo getComponentType()
getComponentType
in interface ClassInfo
public boolean isInterface()
isInterface
in interface ClassInfo
public boolean isPrimitive()
isPrimitive
in interface ClassInfo
public boolean isArray()
isArray
in interface ClassInfo
public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
public static ClassInfo getArrayClassInfo(String className, ClassLoader loader, ClassInfo componentClassInfo)
className
- loader
- componentClassInfo
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |