Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.FieldGen


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

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

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


            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

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

        final FieldGen field = new FieldGen(
                Constants.ACC_PRIVATE | Constants.ACC_FINAL | Constants.ACC_STATIC,
                new ObjectType(TransformationUtil.THREAD_LOCAL_CLASS),
                joinPoint.toString(),
                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,
                new ObjectType(TransformationUtil.THREAD_LOCAL_CLASS),
                joinPoint.toString(),
                cp
        );
        cg.addField(field.getField());
    }
View Full Code Here

    * @return the method
    *
    */
   public Field createInvocationHandlerField()
   {
      FieldGen fg = new FieldGen(Constants.ACC_PRIVATE,
                                 INVOCATION_HANDLER_T,
                                 INVOCATION_HANDLER_FN,
                                 constPool);
      return fg.getField();
   }
View Full Code Here

    * @return the method
    *
    */
   public Field createRuntimeField()
   {
      FieldGen fg = new FieldGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC,
                                 RUNTIME_T,
                                 Runtime.RUNTIME_FN,
                                 constPool);
      return fg.getField();
   }
View Full Code Here

        }
        byte[] serializedAttribute = serialize(attribute);
        Field[] classfileField = m_classGen.getFields();
        for (int i = 0; i < classfileField.length; i++) {
            if (classfileField[i].getName().equals(field.getName())) {
                FieldGen fieldGen = new FieldGen(classfileField[i], m_constantPoolGen);
                Attribute attr = new Unknown(
                        m_constantPoolGen.addUtf8("Custom"),
                        serializedAttribute.length,
                        serializedAttribute,
                        m_constantPoolGen.getConstantPool()
                );
                fieldGen.addAttribute(attr);
                Field newField = fieldGen.getField();
                m_classGen.replaceField(classfileField[i], newField);
            }
        }
    }
View Full Code Here

  private void createField(Element field) throws IllegalXMLVMException
  {
    String name= field.getAttributeValue("name");
    Type t= parseTypeString(field.getAttributeValue("type"));
    short flags= getAccessFlags(field);
    FieldGen f= new FieldGen(flags, t, name, constantPoolGen);
    classGen.addField(f.getField());
  }
View Full Code Here

    // create the fields
    for ( int i=0; i<p.nups; i++ ) {
      boolean isrw = pi.isReadWriteUpvalue( pi.upvals[i] );
      Type uptype = isrw? (Type) TYPE_LOCALUPVALUE: (Type) TYPE_LUAVALUE;
      FieldGen fg = new FieldGen(0, uptype, upvalueName(i), cp);
      cg.addField(fg.getField());
    }
   
    // create the method
    mg = new MethodGen( Constants.ACC_PUBLIC | Constants.ACC_FINAL, // access flags
        RETURN_TYPE_N[superclassType], // return type
View Full Code Here

    }
  }

  private String createLuaIntegerField(int value) {
    String name = PREFIX_CONSTANT+constants.size();
    FieldGen fg = new FieldGen(Constants.ACC_STATIC | Constants.ACC_FINAL,
        TYPE_LUAVALUE, name, cp);
    cg.addField(fg.getField());
    init.append(new PUSH(cp, value));
    init.append(factory.createInvoke(STR_LUAVALUE, "valueOf",
        TYPE_LUAINTEGER, ARG_TYPES_INT, Constants.INVOKESTATIC));
    init.append(factory.createPutStatic(classname, name, TYPE_LUAVALUE));
    return name;
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.