/** * Get or create a constant from the constant pool representing a field in * any class. */ public ConstantFieldInfo addConstantField(String className, String fieldName, TypeDesc type) { ConstantInfo ci = new ConstantFieldInfo (addConstantClass(className), addConstantNameAndType(fieldName, type)); return (ConstantFieldInfo)addConstant(ci); }
/** * Get or create a constant from the constant pool representing an array * class. * * @param dim Number of array dimensions. */ public ConstantClassInfo addConstantClass(String className, int dim) { return (ConstantClassInfo)addConstant(new ConstantClassInfo(this, className, dim)); }
/** * Get or create a constant from the constant pool representing an * interface method in any interface. */ public ConstantInterfaceMethodInfo addConstantInterfaceMethod(String className, String methodName, TypeDesc ret, TypeDesc[] params) { MethodDesc md = MethodDesc.forArguments(ret, params); ConstantInfo ci = new ConstantInterfaceMethodInfo (addConstantClass(className), addConstantNameAndType(methodName, md)); return (ConstantInterfaceMethodInfo)addConstant(ci); }
/** * Get or create a constant string from the constant pool. */ public ConstantStringInfo addConstantString(String str) { return (ConstantStringInfo)addConstant(new ConstantStringInfo(this, str)); }
/** * Get or create a constant from the constant pool representing a method * in any class. If the method returns void, set ret to null. */ public ConstantMethodInfo addConstantMethod(String className, String methodName, TypeDesc ret, TypeDesc[] params) { MethodDesc md = MethodDesc.forArguments(ret, params); ConstantInfo ci = new ConstantMethodInfo (addConstantClass(className), addConstantNameAndType(methodName, md)); return (ConstantMethodInfo)addConstant(ci); }
/** * Get or create a constant double from the constant pool. */ public ConstantDoubleInfo addConstantDouble(double value) { return (ConstantDoubleInfo)addConstant(new ConstantDoubleInfo(value)); }
/** * Get or create a constant from the constant pool representing a class. */ public ConstantClassInfo addConstantClass(String className) { return (ConstantClassInfo)addConstant(new ConstantClassInfo(this, className)); }
/** * Get or create a constant from the constant pool representing a class. */ public ConstantClassInfo addConstantClass(TypeDesc type) { return (ConstantClassInfo)addConstant(new ConstantClassInfo(this, type)); }
/** * Get or create a constant long from the constant pool. */ public ConstantLongInfo addConstantLong(long value) { return (ConstantLongInfo)addConstant(new ConstantLongInfo(value)); }
/** * Get or create a constant float from the constant pool. */ public ConstantFloatInfo addConstantFloat(float value) { return (ConstantFloatInfo)addConstant(new ConstantFloatInfo(value)); }
/** * Get or create a constant UTF string from the constant pool. */ public ConstantUTFInfo addConstantUTF(String str) { return (ConstantUTFInfo)addConstant(new ConstantUTFInfo(str)); }
/** * Get or create a constant name and type structure from the constant pool. */ public ConstantNameAndTypeInfo addConstantNameAndType(ConstantUTFInfo nameConstant, ConstantUTFInfo descConstant) { return (ConstantNameAndTypeInfo)addConstant (new ConstantNameAndTypeInfo(nameConstant, descConstant)); }
/** * Get or create a constant integer from the constant pool. */ public ConstantIntegerInfo addConstantInteger(int value) { return (ConstantIntegerInfo)addConstant(new ConstantIntegerInfo(value)); }
/** * Get or create a constant name and type structure from the constant pool. */ public ConstantNameAndTypeInfo addConstantNameAndType(String name, Descriptor type) { return (ConstantNameAndTypeInfo)addConstant(new ConstantNameAndTypeInfo(this, name, type)); }
/** * Get or create a constant from the constant pool representing a class. */ public ConstantClassInfo addConstantClass(TypeDesc type) { return (ConstantClassInfo)addConstant(new ConstantClassInfo(this, type)); }
/** * Get or create a constant float from the constant pool. */ public ConstantFloatInfo addConstantFloat(float value) { return (ConstantFloatInfo)addConstant(new ConstantFloatInfo(value)); }
/** * Get or create a constant from the constant pool representing an array * class. * * @param dim Number of array dimensions. */ public ConstantClassInfo addConstantClass(String className, int dim) { return (ConstantClassInfo)addConstant(new ConstantClassInfo(this, className, dim)); }
/** * Get or create a constant integer from the constant pool. */ public ConstantIntegerInfo addConstantInteger(int value) { return (ConstantIntegerInfo)addConstant(new ConstantIntegerInfo(value)); }
/** * Get or create a constant long from the constant pool. */ public ConstantLongInfo addConstantLong(long value) { return (ConstantLongInfo)addConstant(new ConstantLongInfo(value)); }
/** * Get or create a constant UTF string from the constant pool. */ public ConstantUTFInfo addConstantUTF(String str) { return (ConstantUTFInfo)addConstant(new ConstantUTFInfo(str)); }