/** * Constructs a <code>BaseType</code>. * * @param typeName <code>void</code>, <code>int</code>, ... */ public BaseType(String typeName) { this(Descriptor.of(typeName).charAt(0)); }
/** * Sets the value of the member. * * @param newClassName fully-qualified class name. */ public void setValue(String newClassName) { String setTo = Descriptor.of(newClassName); valueIndex = cp.addUtf8Info(setTo); }
/** * Changes the enum type name. * * @param typename a fully-qualified type name. */ public void setType(String typename) { typeIndex = cp.addUtf8Info(Descriptor.of(typename)); }
/** * Constructs an annotation including no members. A member can be * later added to the created annotation by <code>addMemberValue()</code>. * * @param typeName the fully-qualified name of the annotation interface type. * @param cp the constant pool table. * * @see #addMemberValue(String, MemberValue) */ public Annotation(String typeName, ConstPool cp) { this(cp.addUtf8Info(Descriptor.of(typeName)), cp); }
/** * Returns the internal representation of the class name in the * JVM. */ public static String toJvmName(CtClass clazz) { if (clazz.isArray()) return of(clazz); else return toJvmName(clazz.getName()); }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { int s = code.addMultiNewarray(type, dim); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return s; // stack size } }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { code.addIconst(value); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return 1; // stack size }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { code.addFconst(value); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return 2; // stack size }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { code.addLdc2w(value); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return 2; // stack size }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { code.addLdc(value); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return 1; // stack size }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { addNewarray(code); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return 1; // stack size } }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { code.addLdc2w(value); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return 2; // stack size }
int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { code.addAload(0); code.addLdc(value); code.addPutfield(Bytecode.THIS, name, Descriptor.of(type)); return 2; // stack size }
int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { code.addAload(0); code.addFconst(value); code.addPutfield(Bytecode.THIS, name, Descriptor.of(type)); return 3; // stack size }
int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { code.addAload(0); code.addLdc2w(value); code.addPutfield(Bytecode.THIS, name, Descriptor.of(type)); return 3; // stack size }
int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { code.addAload(0); code.addLdc2w(value); code.addPutfield(Bytecode.THIS, name, Descriptor.of(type)); return 3; // stack size }
int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { code.addAload(0); addNewarray(code); code.addPutfield(Bytecode.THIS, name, Descriptor.of(type)); return 2; // stack size }
int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { code.addAload(0); int s = code.addMultiNewarray(type, dim); code.addPutfield(Bytecode.THIS, name, Descriptor.of(type)); return s + 1; // stack size }
int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { code.addAload(0); code.addIconst(value); code.addPutfield(Bytecode.THIS, name, Descriptor.of(type)); return 2; // stack size }
int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { try { compileExpr(drv); code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type)); return code.getMaxStack(); } catch (CompileError e) { throw new CannotCompileException(e); } }