Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.Field


                boolean isParameter = local < localsThatAreParameters;
                if (isParameter) {
                    propertySet.addProperty(DeadLocalStoreProperty.IS_PARAMETER);
                }

                Field shadowedField = null;

                for (Field f : javaClass.getFields()) {
                    if (f.getName().equals(lvName) && f.isStatic() == method.isStatic()) {
                        shadowedField = f;
                        propertySet.addProperty(DeadLocalStoreProperty.SHADOWS_FIELD);
View Full Code Here


    /** @return field object with given name, or null
     */
    public Field containsField( String name ) {
        for (Iterator e = field_vec.iterator(); e.hasNext();) {
            Field f = (Field) e.next();
            if (f.getName().equals(name)) {
                return f;
            }
        }
        return null;
    }
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.getEscapedName()),
          cpg.addUtf8(var.getType().toSignature()),
          null, cpg.getConstantPool()));
  }
View Full Code Here

        final ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
        final ClassParser parser = new ClassParser(bis, "");
        final JavaClass javaClass = parser.parse();
        final Field[] fields = javaClass.getFields();
        for (int i = 0; i < fields.length; i++) {
            final Field field = fields[i];
            if (field != null) {
                final ConstantValue cv = field.getConstantValue();
                if (cv != null) {
                    String cvs = cv.toString();
                    //Remove start and end quotes if field is a String
                    if (cvs.startsWith("\"") && cvs.endsWith("\"")) {
                        cvs = cvs.substring(1, cvs.length() - 1);
                    }
                    sb.append(field.getName());
                    sb.append('=');
                    sb.append(cvs);
                    sb.append(LS);
                }
            }
View Full Code Here

  // 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

    // Discard duplicate variable references
    if (dups.contains(varRef)) continue;

    final VariableBase var = varRef.getVariable();
    sortRecordFactory.addField(new Field(ACC_PUBLIC,
             cpg.addUtf8(var.getVariable()),
             cpg.addUtf8(var.getType().toSignature()),
             null, cpg.getConstantPool()));
    dups.add(varRef);
      }
View Full Code Here

    // Discard duplicate variable references
    if (dups.contains(varRef)) continue;

    final VariableBase var = varRef.getVariable();
    sortRecord.addField(new Field(ACC_PUBLIC,
            cpg.addUtf8(var.getVariable()),
            cpg.addUtf8(var.getType().toSignature()),
            null, cpg.getConstantPool()));
    dups.add(varRef);
      }
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

  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

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.