Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.Field


  // Add a new instance variable for each var in closure
  for (int i = 0; i < length; i++) {
      VariableBase var = ((VariableRefBase) _closureVars.get(i)).getVariable();

      filterGen.addField(new Field(ACC_PUBLIC,
          cpg.addUtf8(var.getVariable()),
          cpg.addUtf8(var.getType().toSignature()),
          null, cpg.getConstantPool()));
  }
View Full Code Here


  InstructionList il = methodGen.getInstructionList();

  int[] fieldIndexes = getXSLTC().getNumberFieldIndexes();

  if (fieldIndexes[_level] == -1) {
      Field defaultNode = new Field(ACC_PRIVATE,
            cpg.addUtf8(FieldNames[_level]),
            cpg.addUtf8(NODE_COUNTER_SIG),
            null,
            cpg.getConstantPool());
View Full Code Here

  for (int i = 0; i < closureLen; i++) {
      VariableBase var =
    ((VariableRefBase) _closureVars.get(i)).getVariable();

      nodeCounterGen.addField(new Field(ACC_PUBLIC,
          cpg.addUtf8(var.getVariable()),
          cpg.addUtf8(var.getType().toSignature()),
          null, cpg.getConstantPool()));
  }
View Full Code Here

    */
    private void makePrivateProtected (ClassGen cg)
    {
        Field[] fields = cg.getFields();
        for (int i = 0; i < fields.length; i++) {
            Field f = fields[i];
            if (f.isPrivate()  && f.isStatic()) {
                f.isPrivate(false);
                f.isProtected(true);
            }
        }
    }
View Full Code Here

        // fields
        List fieldList = new ArrayList();
        Field[] fields = javaClass.getFields();
        for (int i = 0; i < fields.length; i++) {
            Field field = fields[i];
            fieldList.add(createFieldMetaData(field));
        }
        classMetaData.setFields(fieldList);

        try {
View Full Code Here

  InstructionList il = methodGen.getInstructionList();

  int[] fieldIndexes = getXSLTC().getNumberFieldIndexes();

  if (fieldIndexes[_level] == -1) {
      Field defaultNode = new Field(ACC_PRIVATE,
            cpg.addUtf8(FieldNames[_level]),
            cpg.addUtf8(NODE_COUNTER_SIG),
            null,
            cpg.getConstantPool());
View Full Code Here

  else {
      String signature = _type.toSignature();

      // Global variables are store in class fields
      if (classGen.containsField(name) == null) {
    classGen.addField(new Field(ACC_PUBLIC,
              cpg.addUtf8(name),
              cpg.addUtf8(signature),
              null, cpg.getConstantPool()));

    // Push a reference to "this" for putfield
View Full Code Here

    il.append(_type.STORE(_local.getIndex()));
      }
  }
  else {
      if (classGen.containsField(name) == null) {
    classGen.addField(new Field(ACC_PUBLIC, cpg.addUtf8(name),
              cpg.addUtf8(signature),
              null, cpg.getConstantPool()));
    il.append(classGen.loadTranslet());
    il.append(DUP);
    il.append(new PUSH(cpg, name));
View Full Code Here

            Util.getJCRefType(NODE_ITERATOR_SIG),
            il.getEnd(), null);

  // Add a new private field if this is the main class
  if (!classGen.isExternal()) {
      final Field iterator =
    new Field(ACC_PRIVATE,
        cpg.addUtf8(iteratorName),
        cpg.addUtf8(NODE_ITERATOR_SIG),
        null, cpg.getConstantPool());
      classGen.addField(iterator);
      iteratorIndex = cpg.addFieldref(classGen.getClassName(),
View Full Code Here

            Util.getJCRefType(NODE_ITERATOR_SIG),
            il.getEnd(), null);

  // Add a new private field if this is the main class
  if (!classGen.isExternal()) {
      final Field iterator =
    new Field(ACC_PRIVATE,
        cpg.addUtf8(iteratorName),
        cpg.addUtf8(NODE_ITERATOR_SIG),
        null, cpg.getConstantPool());
      classGen.addField(iterator);
      iteratorIndex = cpg.addFieldref(classGen.getClassName(),
View Full Code Here

TOP

Related Classes of org.apache.bcel.classfile.Field

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.