|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjasm.lang.ClassFile
public class ClassFile
Nested Class Summary | |
---|---|
static class |
ClassFile.Field
|
static class |
ClassFile.Method
|
static class |
ClassFile.Parameter
|
Field Summary | |
---|---|
protected java.util.ArrayList<BytecodeAttribute> |
attributes
|
protected java.util.ArrayList<ClassFile.Field> |
fields
|
protected java.util.List<JvmType.Clazz> |
interfaces
|
protected java.util.ArrayList<ClassFile.Method> |
methods
|
protected java.util.List<Modifier> |
modifiers
|
protected JvmType.Clazz |
superClazz
|
protected JvmType.Clazz |
type
|
protected int |
version
|
Constructor Summary | |
---|---|
ClassFile(int version,
JvmType.Clazz type,
JvmType.Clazz superClazz,
java.util.List<JvmType.Clazz> interfaces,
java.util.List<Modifier> modifiers,
BytecodeAttribute... attributes)
|
|
ClassFile(int version,
JvmType.Clazz type,
JvmType.Clazz superClazz,
java.util.List<JvmType.Clazz> interfaces,
java.util.List<Modifier> modifiers,
java.util.Collection<BytecodeAttribute> attributes)
|
Method Summary | |
---|---|
BytecodeAttribute |
attribute(java.lang.String name)
|
java.util.List<BytecodeAttribute> |
attributes()
|
java.util.ArrayList<Constant.Info> |
constantPool()
This method builds a constant pool for this class file. |
static java.lang.String |
descriptor(JvmType t,
boolean generic)
This method returns a JVM descriptor string for the type in question. |
ClassFile.Field |
field(java.lang.String name)
|
java.util.List<ClassFile.Field> |
fields()
|
boolean |
hasModifier(java.lang.Class modClass)
Check whether this method has one of the "base" modifiers (e.g. |
java.util.List<JvmType.Clazz> |
inners()
|
java.util.List<JvmType.Clazz> |
interfaces()
|
boolean |
isAbstract()
Check whether this method is abstract |
boolean |
isFinal()
Check whether this method is final |
boolean |
isInnerClass()
Check whether or not this is an inner class. |
boolean |
isInterface()
Check whether this method is abstract |
boolean |
isNative()
Check whether this method is native |
boolean |
isPrivate()
Check whether this method is private |
boolean |
isProtected()
Check whether this method is protected |
boolean |
isPublic()
Check whether this method is public |
boolean |
isStatic()
Check whether this method is static |
boolean |
isSynchronized()
Check whether this method is synchronized |
boolean |
isSynthetic()
Check whether this method is synthetic |
java.util.List<ClassFile.Method> |
methods()
|
java.util.List<ClassFile.Method> |
methods(java.lang.String name)
|
java.util.List<Modifier> |
modifiers()
|
java.lang.String |
name()
|
void |
setType(JvmType.Clazz t)
|
static int |
slotSize(JvmType type)
Determine the slot size for the corresponding Java type. |
JvmType.Clazz |
superClass()
|
JvmType.Clazz |
type()
|
int |
version()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int version
protected JvmType.Clazz type
protected JvmType.Clazz superClazz
protected java.util.List<JvmType.Clazz> interfaces
protected java.util.List<Modifier> modifiers
protected java.util.ArrayList<BytecodeAttribute> attributes
protected java.util.ArrayList<ClassFile.Field> fields
protected java.util.ArrayList<ClassFile.Method> methods
Constructor Detail |
---|
public ClassFile(int version, JvmType.Clazz type, JvmType.Clazz superClazz, java.util.List<JvmType.Clazz> interfaces, java.util.List<Modifier> modifiers, BytecodeAttribute... attributes)
public ClassFile(int version, JvmType.Clazz type, JvmType.Clazz superClazz, java.util.List<JvmType.Clazz> interfaces, java.util.List<Modifier> modifiers, java.util.Collection<BytecodeAttribute> attributes)
Method Detail |
---|
public JvmType.Clazz type()
public java.lang.String name()
public JvmType.Clazz superClass()
public java.util.List<JvmType.Clazz> interfaces()
public java.util.List<JvmType.Clazz> inners()
public java.util.List<BytecodeAttribute> attributes()
public BytecodeAttribute attribute(java.lang.String name)
public java.util.List<Modifier> modifiers()
public java.util.List<ClassFile.Field> fields()
public ClassFile.Field field(java.lang.String name)
public java.util.List<ClassFile.Method> methods()
public java.util.List<ClassFile.Method> methods(java.lang.String name)
public int version()
public boolean hasModifier(java.lang.Class modClass)
modifier
-
public boolean isInterface()
public boolean isAbstract()
public boolean isFinal()
public boolean isStatic()
public boolean isPublic()
public boolean isProtected()
public boolean isPrivate()
public boolean isNative()
public boolean isSynchronized()
public boolean isSynthetic()
public boolean isInnerClass()
public void setType(JvmType.Clazz t)
public java.util.ArrayList<Constant.Info> constantPool()
public static java.lang.String descriptor(JvmType t, boolean generic)
Type | Descriptor |
int | |
I | |
boolean | |
Z | |
float[] | |
F[ | |
java.lang.Integer | |
Ljava/lang/Integer; | |
int(Double,Float) | |
(DF)I | |
The descriptor string is used, amongst other things, to uniquely identify a class in the ClassTable.
See the JVM Specification for more information.
t
- The type to generate the descriptor forgeneric
- True indicates generic information should be included.
public static int slotSize(JvmType type)
type
- The type to determine the slot size for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |