Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.FieldGen


     *
     * @param context the transformation context
     * @param cg the class gen
     */
    private void addSerialVersionUidField(final Context context, final ClassGen cg) {
        FieldGen field = new FieldGen(
                Constants.ACC_FINAL | Constants.ACC_STATIC,
                Type.LONG,
                TransformationUtil.SERIAL_VERSION_UID_FIELD,
                cg.getConstantPool());
        final long uid = TransformationUtil.calculateSerialVersionUid(context, cg);
        field.setInitValue(uid);
        TransformationUtil.addField(cg, field.getField());
    }
View Full Code Here


        if (cg.containsField(joinPoint.toString()) != null) {
            return;
        }

        final FieldGen field = new FieldGen(
                Constants.ACC_PRIVATE | Constants.ACC_FINAL,
                joinPointType,
                joinPoint.toString(),
                cp);

        cg.addField(field.getField());
    }
View Full Code Here

        for (int i = 0; i < fields.length; i++) {
            if (fields[i].getName().equals(TransformationUtil.STATIC_CLASS_FIELD))
                return;
        }

        final FieldGen field = new FieldGen(
                Constants.ACC_PRIVATE | Constants.ACC_FINAL | Constants.ACC_STATIC,
                new ObjectType("java.lang.Class"),
                TransformationUtil.STATIC_CLASS_FIELD,
                cp
        );

        cg.addField(field.getField());
    }
View Full Code Here

/* 429 */     return getMethodAndTidyup(mg);
/*     */   }
/*     */
/*     */   public Field createInvocationHandlerField()
/*     */   {
/* 447 */     FieldGen fg = new FieldGen(2, INVOCATION_HANDLER_T, "invocationHandler", this.constPool);
/*     */
/* 451 */     return fg.getField();
/*     */   }
View Full Code Here

/* 451 */     return fg.getField();
/*     */   }
/*     */
/*     */   public Field createRuntimeField()
/*     */   {
/* 469 */     FieldGen fg = new FieldGen(9, RUNTIME_T, "runtime", this.constPool);
/*     */
/* 473 */     return fg.getField();
/*     */   }
View Full Code Here

                il.dispose();
            }
        }

        FieldGen assertor = new FieldGen( Constants.ACC_PUBLIC & Constants.ACC_STATIC, Type.STRING, "assertor", cp );
        cg.addField( assertor.getField() );

        FileOutputStream output = null;
        try
        {
            File destFile = new File( destination, classfile );
View Full Code Here

     * @param cg the classgen
     */
    private void addUuidField(final ClassGen cg) {
        if (cg.containsField(TransformationUtil.UUID_FIELD) == null) {

            FieldGen field = new FieldGen(
                    Constants.ACC_PRIVATE | Constants.ACC_FINAL,
                    Type.STRING,
                    TransformationUtil.UUID_FIELD,
                    cg.getConstantPool());

            TransformationUtil.addField(cg, field.getField());
        }
    }
View Full Code Here

     * @param cg the classgen
     */
    private void addMapField(final ClassGen cg) {
        if (cg.containsField(TransformationUtil.META_DATA_FIELD) == null) {

            FieldGen field = new FieldGen(
                    Constants.ACC_PRIVATE | Constants.ACC_FINAL,
                    new ObjectType("java.util.Map"),
                    TransformationUtil.META_DATA_FIELD,
                    cg.getConstantPool());

            TransformationUtil.addField(cg, field.getField());
        }
    }
View Full Code Here

        if (cg.containsField(joinPoint) != null) {
            return;
        }

        final FieldGen field = new FieldGen(
                Constants.ACC_PRIVATE | Constants.ACC_FINAL,
                new ObjectType(TransformationUtil.THREAD_LOCAL_CLASS),
                joinPoint,
                cp
        );
        cg.addField(field.getField());
    }
View Full Code Here

        if (cg.containsField(joinPoint.toString()) != null) {
            return;
        }

        final FieldGen field = new FieldGen(
                Constants.ACC_PRIVATE | Constants.ACC_FINAL,
                joinPointType,
                joinPoint.toString(),
                cp);

        cg.addField(field.getField());
    }
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.FieldGen

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.