Lines Matching defs:code
38 * Creates a <code>CtField</code> object.
40 * with <code>CtClass.addField()</code>.
42 * by a <code>CtField.Initializer</code> object.
45 * call <code>CtNewMethod.getter()</code> and
46 * <code>CtNewMethod.setter()</code>.
66 * with <code>CtClass.addField()</code>.
68 * by a <code>CtField.Initializer</code> object.
71 * call <code>CtNewMethod.getter()</code> and
72 * <code>CtNewMethod.setter()</code>.
143 * Compiles the given source code and creates a field.
144 * Examples of the source code are:
150 * <p>Note that the source code ends with <code>';'</code>
184 * <code>getFieldInfo()</code>.
186 * <p>The <code>FieldInfo</code> object obtained by this method
188 * on a class file generated by <code>toBytecode()</code>,
189 * <code>toClass()</code>, etc in <code>CtClass</code>.
191 * <p>This method is available even if the <code>CtClass</code>
193 * frozen, the <code>FieldInfo</code> might be also pruned.
247 * @return <code>true</code> if the annotation is found, otherwise <code>false</code>.
262 * For example, if an annotation <code>@Author</code> is associated
263 * with this field, an <code>Author</code> object is returned.
265 * the <code>Author</code> object.
268 * @return the annotation if found, otherwise <code>null</code>.
325 * <code>getSignature()</code> returns the same string.
328 * contained in the <code>SignatureAttirbute</code>. It is
361 * or <code>String</code> type. Otherwise, it returns <code>null</code>.
362 * A constant field is <code>static</code> and <code>final</code>.
364 * @return a <code>Integer</code>, <code>Long</code>, <code>Float</code>,
365 * <code>Double</code>, <code>Boolean</code>,
366 * or <code>String</code> object
368 * <code>null</code> if it is not a constant field
370 * or <code>String</code>.
442 * <code>Initializer</code> is passed to
443 * <code>CtClass.addField()</code> with a <code>CtField</code>.
445 * <p>This class cannot be instantiated with the <code>new</code> operator.
446 * Factory methods such as <code>byParameter()</code> and
447 * <code>byNew</code>
496 * The field must be <code>java.lang.String</code> type.
529 * <ul><code>Object obj</code> - the object including the field.<br>
552 * <ul><code>Object obj</code> - the object including the field.<br>
553 * <code>String[] strs</code> - the character strings specified
554 * by <code>stringParams</code><br>
558 * receives only <code>strs</code>.
580 * <ul><code>Object obj</code> - the object including the field.<br>
581 * <code>Object[] args</code> - the parameters passed to the
609 * <ul><code>Object obj</code> - the object including the field.<br>
610 * <code>String[] strs</code> - the character strings specified
611 * by <code>stringParams</code><br>
612 * <code>Object[] args</code> - the parameters passed to the
618 * only <code>strs</code>.
640 * <ul><code>Object obj</code> - the object including the field.<br>
670 * <ul><code>Object obj</code> - the object including the field.<br>
671 * <code>String[] strs</code> - the character strings specified
672 * by <code>stringParams</code><br>
676 * receive only <code>strs</code>.
705 * <ul><code>Object obj</code> - the object including the field.<br>
706 * <code>Object[] args</code> - the parameters passed to the
738 * <ul><code>Object obj</code> - the object including the field.<br>
739 * <code>String[] strs</code> - the character strings specified
740 * by <code>stringParams</code><br>
741 * <code>Object[] args</code> - the parameters passed to the
747 * receive only <code>strs</code>.
786 * @param sizes an <code>int</code> array of the size in every
813 abstract int compile(CtClass type, String name, Bytecode code,
819 Bytecode code, Javac drv) throws CannotCompileException;
829 int compile(CtClass type, String name, Bytecode code,
834 code.addAload(0);
836 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
837 return code.getMaxStack();
844 int compileIfStatic(CtClass type, String name, Bytecode code,
849 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
850 return code.getMaxStack();
929 int compile(CtClass type, String name, Bytecode code,
934 code.addAload(0);
936 int s = code.addLoad(nth, type) + 1;
937 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
973 int compileIfStatic(CtClass type, String name, Bytecode code,
994 int compile(CtClass type, String name, Bytecode code,
1000 code.addAload(0);
1001 code.addNew(objectType);
1002 code.add(Bytecode.DUP);
1003 code.addAload(0);
1008 stacksize = compileStringParameter(code) + 4;
1011 stacksize += CtNewWrappedMethod.compileParameterList(code,
1014 code.addInvokespecial(objectType, "<init>", getDescriptor());
1015 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1038 int compileIfStatic(CtClass type, String name, Bytecode code,
1043 code.addNew(objectType);
1044 code.add(Bytecode.DUP);
1051 stacksize += compileStringParameter(code);
1054 code.addInvokespecial(objectType, "<init>", desc);
1055 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
1059 protected final int compileStringParameter(Bytecode code)
1063 code.addIconst(nparam);
1064 code.addAnewarray(javaLangString);
1066 code.add(Bytecode.DUP); // dup
1067 code.addIconst(j); // iconst_<j>
1068 code.addLdc(stringParams[j]); // ldc ...
1069 code.add(Bytecode.AASTORE); // aastore
1090 int compile(CtClass type, String name, Bytecode code,
1096 code.addAload(0);
1097 code.addAload(0);
1102 stacksize = compileStringParameter(code) + 2;
1105 stacksize += CtNewWrappedMethod.compileParameterList(code,
1110 code.addInvokestatic(objectType, methodName, mDesc);
1111 code.addPutfield(Bytecode.THIS, name, typeDesc);
1134 int compileIfStatic(CtClass type, String name, Bytecode code,
1144 stacksize += compileStringParameter(code);
1148 code.addInvokestatic(objectType, methodName, desc + typeDesc);
1149 code.addPutstatic(Bytecode.THIS, name, typeDesc);
1165 int compile(CtClass type, String name, Bytecode code,
1169 code.addAload(0);
1170 code.addIconst(value);
1171 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1175 int compileIfStatic(CtClass type, String name, Bytecode code,
1178 code.addIconst(value);
1179 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
1198 int compile(CtClass type, String name, Bytecode code,
1202 code.addAload(0);
1203 code.addLdc2w(value);
1204 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1208 int compileIfStatic(CtClass type, String name, Bytecode code,
1211 code.addLdc2w(value);
1212 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
1234 int compile(CtClass type, String name, Bytecode code,
1238 code.addAload(0);
1239 code.addFconst(value);
1240 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1244 int compileIfStatic(CtClass type, String name, Bytecode code,
1247 code.addFconst(value);
1248 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
1270 int compile(CtClass type, String name, Bytecode code,
1274 code.addAload(0);
1275 code.addLdc2w(value);
1276 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1280 int compileIfStatic(CtClass type, String name, Bytecode code,
1283 code.addLdc2w(value);
1284 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
1301 int compile(CtClass type, String name, Bytecode code,
1305 code.addAload(0);
1306 code.addLdc(value);
1307 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1311 int compileIfStatic(CtClass type, String name, Bytecode code,
1314 code.addLdc(value);
1315 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
1333 private void addNewarray(Bytecode code) {
1335 code.addNewarray(((CtPrimitiveType)type).getArrayType(),
1338 code.addAnewarray(type, size);
1341 int compile(CtClass type, String name, Bytecode code,
1345 code.addAload(0);
1346 addNewarray(code);
1347 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1351 int compileIfStatic(CtClass type, String name, Bytecode code,
1354 addNewarray(code);
1355 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
1371 int compile(CtClass type, String name, Bytecode code,
1375 code.addAload(0);
1376 int s = code.addMultiNewarray(type, dim);
1377 code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
1381 int compileIfStatic(CtClass type, String name, Bytecode code,
1384 int s = code.addMultiNewarray(type, dim);
1385 code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));