| Modifier and Type | Method and Description |
|---|---|
FieldInfo |
addNewField(int modifiers,
int typeIndex,
int nameIndex)
Factory method that creates a new field in the class being modeled
|
FieldInfo |
addNewField(int modifiers,
int typeIndex,
int nameIndex,
int cvNameIndex,
int constantValueIndex)
Factory method that creates a new field with a constant value in the
class being modeled
|
MethodInfo |
addNewMethod(int modifiers,
int typeIndex,
int nameIndex,
int exceptionIndex,
int[] exceptionTypeIndices,
int codeIndex)
Adds a new method to this class.
|
int |
classIndex()
Get the index into the constant pool of class.
|
void |
commit()
Commit any changes to the file or to the virtual machine.
|
void |
commitOnly(java.util.Set methods,
java.util.Set fields)
Commits only certain methods and fields.
|
Constant[] |
constants()
Returns an array of the constants in the constant pool.
|
void |
deleteField(int nameIndex)
Deletes a field from this class
|
void |
deleteMethod(int nameIndex,
int typeIndex)
Deletes a method from this class
|
FieldInfo[] |
fields()
Get an array of FieldInfo structures for each field in the class.
|
int[] |
interfaceIndices()
Get the indices into the constant pool of class's interfaces.
|
ClassInfoLoader |
loader()
Get the class info loader for the class.
|
MethodInfo[] |
methods()
Returns an array of MethodInfo structures for each method in the class.
|
int |
modifiers()
Get the modifiers of the class.
|
java.lang.String |
name()
Get the name of the class.
|
void |
print(java.io.PrintStream out) |
void |
print(java.io.PrintWriter out) |
void |
setClassIndex(int index)
Set the index into the constant pool of class.
|
void |
setConstants(Constant[] constants)
Set all the constants in the constant pool.
|
void |
setInterfaceIndices(int[] indices)
Set the indices into the constant pool of class's interfaces.
|
void |
setMethods(MethodInfo[] methods)
Sets the methods in this class.
|
void |
setModifiers(int modifiers)
Set the modifiers of the class.
|
void |
setSuperclassIndex(int index)
Set the index into the constant pool of class's superclass.
|
int |
superclassIndex()
Get the index into the constant pool of class's superclass.
|
java.lang.String |
toString() |
ClassInfoLoader loader()
java.lang.String name()
int classIndex()
int superclassIndex()
int[] interfaceIndices()
void setClassIndex(int index)
index - The index of the class.void setSuperclassIndex(int index)
index - The index of the superclass.void setInterfaceIndices(int[] indices)
indices - The indices of the interfaces.void setModifiers(int modifiers)
modifiers - A bit vector of modifier flags for the class.Modifiersint modifiers()
ModifiersFieldInfo[] fields()
FieldInfoMethodInfo[] methods()
void setMethods(MethodInfo[] methods)
Constant[] constants()
void setConstants(Constant[] constants)
constants - The array of Constants.Constantvoid commit()
void commitOnly(java.util.Set methods,
java.util.Set fields)
methods - Methods (MethodInfos) to commit. If null,
all methods are committed.fields - Fields (FieldInfos) to commit. If null,
all fields are committed.FieldInfo addNewField(int modifiers, int typeIndex, int nameIndex)
FieldInfo addNewField(int modifiers, int typeIndex, int nameIndex, int cvNameIndex, int constantValueIndex)
cvNameIndex - The index in the class's constant pool for the UTF8 constant
"ConstantValue"constantValueIndex - The index in the class's constant pool for the constant valuevoid deleteField(int nameIndex)
nameIndex - Index in the constant pool of the name of the field to be
deletedjava.lang.IllegalArgumentException - The class modeled by this
ClassInfo does not contain a field whose name is at
the given indexvoid deleteMethod(int nameIndex,
int typeIndex)
nameIndex - Index in the constant pool of the name of the method to be
deletedtypeIndex - Index in the constant pool of the type of the method to be
deletedjava.lang.IllegalArgumentException - The class modeled by this
ClassInfo does not contain a method whose name and
type are not at the given indicesMethodInfo addNewMethod(int modifiers, int typeIndex, int nameIndex, int exceptionIndex, int[] exceptionTypeIndices, int codeIndex)
modifiers - The modifiers
for the new methodtypeIndex - The index of the type (conglomeration of the parameter types
and the return type) for this method in the class's constant
poolnameIndex - The index of the name of the method in the class's constant
poolexceptionIndex - The index of the UTF8 string "Exceptions" in the class's
constant poolexceptionTypeIndices - The indices in the class's constant pool of the type of the
exceptions thrown by this methodcodeIndex - The index of the UTF8 string "Code" in the class's constant
poolvoid print(java.io.PrintStream out)
void print(java.io.PrintWriter out)
java.lang.String toString()
toString in class java.lang.Object