public class ConstantAdder extends Object implements ConstantVisitor
| Constructor and Description |
|---|
ConstantAdder(ProgramClass targetClass)
Creates a new ConstantAdder that will copy constants into the given
target class.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addConstant(Clazz clazz,
Constant constant)
Adds a copy of the given constant in the given class and returns
its index.
|
int |
addConstant(Clazz clazz,
int constantIndex)
Adds a copy of the specified constant in the given class and returns
its index.
|
int |
getConstantIndex()
Returns the index of the most recently created constant in the constant
pool of the target class.
|
void |
visitClassConstant(Clazz clazz,
ClassConstant classConstant) |
void |
visitDoubleConstant(Clazz clazz,
DoubleConstant doubleConstant) |
void |
visitFieldrefConstant(Clazz clazz,
FieldrefConstant fieldrefConstant) |
void |
visitFloatConstant(Clazz clazz,
FloatConstant floatConstant) |
void |
visitIntegerConstant(Clazz clazz,
IntegerConstant integerConstant) |
void |
visitInterfaceMethodrefConstant(Clazz clazz,
InterfaceMethodrefConstant interfaceMethodrefConstant) |
void |
visitInvokeDynamicConstant(Clazz clazz,
InvokeDynamicConstant invokeDynamicConstant) |
void |
visitLongConstant(Clazz clazz,
LongConstant longConstant) |
void |
visitMethodHandleConstant(Clazz clazz,
MethodHandleConstant methodHandleConstant) |
void |
visitMethodrefConstant(Clazz clazz,
MethodrefConstant methodrefConstant) |
void |
visitMethodTypeConstant(Clazz clazz,
MethodTypeConstant methodTypeConstant) |
void |
visitNameAndTypeConstant(Clazz clazz,
NameAndTypeConstant nameAndTypeConstant) |
void |
visitStringConstant(Clazz clazz,
StringConstant stringConstant) |
void |
visitUtf8Constant(Clazz clazz,
Utf8Constant utf8Constant) |
public ConstantAdder(ProgramClass targetClass)
public int addConstant(Clazz clazz, int constantIndex)
public int addConstant(Clazz clazz, Constant constant)
public int getConstantIndex()
public void visitIntegerConstant(Clazz clazz, IntegerConstant integerConstant)
visitIntegerConstant in interface ConstantVisitorpublic void visitLongConstant(Clazz clazz, LongConstant longConstant)
visitLongConstant in interface ConstantVisitorpublic void visitFloatConstant(Clazz clazz, FloatConstant floatConstant)
visitFloatConstant in interface ConstantVisitorpublic void visitDoubleConstant(Clazz clazz, DoubleConstant doubleConstant)
visitDoubleConstant in interface ConstantVisitorpublic void visitStringConstant(Clazz clazz, StringConstant stringConstant)
visitStringConstant in interface ConstantVisitorpublic void visitUtf8Constant(Clazz clazz, Utf8Constant utf8Constant)
visitUtf8Constant in interface ConstantVisitorpublic void visitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)
visitInvokeDynamicConstant in interface ConstantVisitorpublic void visitMethodHandleConstant(Clazz clazz, MethodHandleConstant methodHandleConstant)
visitMethodHandleConstant in interface ConstantVisitorpublic void visitFieldrefConstant(Clazz clazz, FieldrefConstant fieldrefConstant)
visitFieldrefConstant in interface ConstantVisitorpublic void visitInterfaceMethodrefConstant(Clazz clazz, InterfaceMethodrefConstant interfaceMethodrefConstant)
visitInterfaceMethodrefConstant in interface ConstantVisitorpublic void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
visitMethodrefConstant in interface ConstantVisitorpublic void visitClassConstant(Clazz clazz, ClassConstant classConstant)
visitClassConstant in interface ConstantVisitorpublic void visitMethodTypeConstant(Clazz clazz, MethodTypeConstant methodTypeConstant)
visitMethodTypeConstant in interface ConstantVisitorpublic void visitNameAndTypeConstant(Clazz clazz, NameAndTypeConstant nameAndTypeConstant)
visitNameAndTypeConstant in interface ConstantVisitorCopyright © 2015. All Rights Reserved.