|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aspectj.apache.bcel.classfile.Modifiers org.aspectj.apache.bcel.classfile.JavaClass
public class JavaClass
Represents a Java class, i.e., the data structures, constant pool, fields, methods and commands contained in a Java .class file. See JVM specification for details. The intent of this class is to represent a parsed or otherwise existing class file. Those interested in programatically generating classes should see the ClassGen class.
ClassGen
Field Summary |
---|
Fields inherited from class org.aspectj.apache.bcel.classfile.Modifiers |
---|
modifiers |
Constructor Summary | |
---|---|
JavaClass(int classnameIndex,
int superclassnameIndex,
java.lang.String filename,
int major,
int minor,
int access_flags,
ConstantPool cpool,
int[] interfaces,
Field[] fields,
Method[] methods,
Attribute[] attributes)
|
Method Summary | |
---|---|
void |
accept(ClassVisitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. |
void |
dump(java.io.DataOutputStream file)
Dump Java class to output stream in binary format. |
void |
dump(java.io.File file)
Dump class to a file. |
void |
dump(java.io.OutputStream file)
Dump Java class to output stream in binary format. |
void |
dump(java.lang.String file_name)
Dump class to a file named file_name. |
java.util.Collection<JavaClass> |
getAllInterfaces()
Get all interfaces implemented by this JavaClass (transitively). |
AnnotationGen[] |
getAnnotations()
|
Attribute[] |
getAttributes()
|
byte[] |
getBytes()
|
java.lang.String |
getClassName()
|
int |
getClassNameIndex()
|
ConstantPool |
getConstantPool()
|
Field |
getField(java.lang.reflect.Field field)
|
Field[] |
getFields()
|
java.lang.String |
getFileName()
|
java.lang.String |
getGenericSignature()
Hunts for a signature attribute on the member and returns its contents. |
int[] |
getInterfaceIndices()
|
java.lang.String[] |
getInterfaceNames()
|
JavaClass[] |
getInterfaces()
Get interfaces directly implemented by this JavaClass. |
int |
getMajor()
|
Method |
getMethod(java.lang.reflect.Constructor<?> c)
|
Method |
getMethod(java.lang.reflect.Method m)
|
Method[] |
getMethods()
|
int |
getMinor()
|
java.lang.String |
getPackageName()
|
Repository |
getRepository()
Gets the ClassRepository which holds its definition. |
Signature |
getSignatureAttribute()
|
java.lang.String |
getSourceFileName()
|
JavaClass |
getSuperClass()
|
JavaClass[] |
getSuperClasses()
|
java.lang.String |
getSuperclassName()
|
int |
getSuperclassNameIndex()
|
boolean |
implementationOf(JavaClass inter)
|
boolean |
instanceOf(JavaClass super_class)
Equivalent to runtime "instanceof" operator. |
boolean |
isAnnotation()
Returns true if this class represents an annotation, i.e. |
boolean |
isAnonymous()
|
boolean |
isClass()
|
boolean |
isEnum()
Returns true if this class represents an enum type |
boolean |
isGeneric()
|
boolean |
isNested()
|
boolean |
isSuper()
|
void |
setAttributes(Attribute[] attributes)
|
void |
setClassName(java.lang.String class_name)
|
void |
setClassNameIndex(int class_name_index)
|
void |
setConstantPool(ConstantPool constant_pool)
|
void |
setFields(Field[] fields)
|
void |
setFileName(java.lang.String file_name)
Set File name of class, aka SourceFile attribute value |
void |
setInterfaceNames(java.lang.String[] interface_names)
|
void |
setInterfaces(int[] interfaces)
|
void |
setMajor(int major)
|
void |
setMethods(Method[] methods)
|
void |
setMinor(int minor)
|
void |
setRepository(Repository repository)
Sets the ClassRepository which loaded the JavaClass. |
void |
setSourceFileName(java.lang.String source_file_name)
Set absolute path to file this class was read from. |
void |
setSuperclassName(java.lang.String superclass_name)
|
void |
setSuperclassNameIndex(int superclass_name_index)
|
java.lang.String |
toString()
|
Methods inherited from class org.aspectj.apache.bcel.classfile.Modifiers |
---|
getModifiers, isAbstract, isBridge, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVarargs, isVolatile, setModifiers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JavaClass(int classnameIndex, int superclassnameIndex, java.lang.String filename, int major, int minor, int access_flags, ConstantPool cpool, int[] interfaces, Field[] fields, Method[] methods, Attribute[] attributes)
Method Detail |
---|
public void accept(ClassVisitor v)
accept
in interface Node
v
- Visitor objectpublic void dump(java.io.File file) throws java.io.IOException
file
- Output file
java.io.IOException
public void dump(java.lang.String file_name) throws java.io.IOException
file_name
- Output file name
java.io.IOException
public byte[] getBytes()
public void dump(java.io.OutputStream file) throws java.io.IOException
java.io.IOException
public void dump(java.io.DataOutputStream file) throws java.io.IOException
java.io.IOException
public Attribute[] getAttributes()
public AnnotationGen[] getAnnotations()
public java.lang.String getClassName()
public java.lang.String getPackageName()
public int getClassNameIndex()
public ConstantPool getConstantPool()
public Field[] getFields()
public java.lang.String getFileName()
public java.lang.String[] getInterfaceNames()
public int[] getInterfaceIndices()
public int getMajor()
public Method[] getMethods()
public Method getMethod(java.lang.reflect.Method m)
public Method getMethod(java.lang.reflect.Constructor<?> c)
public Field getField(java.lang.reflect.Field field)
public int getMinor()
public java.lang.String getSourceFileName()
public java.lang.String getSuperclassName()
public int getSuperclassNameIndex()
public void setAttributes(Attribute[] attributes)
attributes
- .public void setClassName(java.lang.String class_name)
class_name
- .public void setClassNameIndex(int class_name_index)
class_name_index
- .public void setConstantPool(ConstantPool constant_pool)
constant_pool
- .public void setFields(Field[] fields)
fields
- .public void setFileName(java.lang.String file_name)
public void setInterfaceNames(java.lang.String[] interface_names)
interface_names
- .public void setInterfaces(int[] interfaces)
interfaces
- .public void setMajor(int major)
public void setMethods(Method[] methods)
public void setMinor(int minor)
public void setSourceFileName(java.lang.String source_file_name)
public void setSuperclassName(java.lang.String superclass_name)
superclass_name
- .public void setSuperclassNameIndex(int superclass_name_index)
superclass_name_index
- .public java.lang.String toString()
toString
in class java.lang.Object
public final boolean isSuper()
public final boolean isClass()
public final boolean isAnonymous()
public final boolean isNested()
public final boolean isAnnotation()
public final boolean isEnum()
public Repository getRepository()
public void setRepository(Repository repository)
public final boolean instanceOf(JavaClass super_class)
public boolean implementationOf(JavaClass inter)
public JavaClass getSuperClass()
public JavaClass[] getSuperClasses()
public JavaClass[] getInterfaces()
public java.util.Collection<JavaClass> getAllInterfaces()
public final java.lang.String getGenericSignature()
public boolean isGeneric()
public final Signature getSignatureAttribute()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |