Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.ConstantFieldref


      {
         throw new TinyVMException("Classfile error: Instruction requiring "
            + "CONSTANT_Fieldref entry got "
            + (pEntry == null? "null" : pEntry.getClass().getName()));
      }
      ConstantFieldref pFieldEntry = (ConstantFieldref) pEntry;
      String className = pFieldEntry.getClass(iCF.getConstantPool()).replace(
         '.', '/');
      ClassRecord pClassRecord = getClassRecord(className);
      if (pClassRecord == null)
      {
         throw new TinyVMException("Attempt to use a field from a primitive array " +
                 className + " from class " + iCF.getClassName() + " method " + iFullName);

      }
      ConstantNameAndType cnat = (ConstantNameAndType) iCF.getConstantPool()
         .getConstant(pFieldEntry.getNameAndTypeIndex());
      String pName = cnat.getName(iCF.getConstantPool());
      int pOffset = pClassRecord.getInstanceFieldOffset(pName);
      if (pOffset == -1)
      {
         throw new TinyVMException("Error: Didn't find field " + className
View Full Code Here


        }
        adjustSize();
        class_index = addClass(class_name);
        name_and_type_index = addNameAndType(field_name, signature);
        ret = index;
        constants[index++] = new ConstantFieldref(class_index, name_and_type_index);
        String key = class_name + FIELDREF_DELIM + field_name + FIELDREF_DELIM + signature;
        if (!cp_table.containsKey(key)) {
            cp_table.put(key, new Index(ret));
        }
        return ret;
View Full Code Here

                        + "\">Class index(" + class_index + ")</A>\n" + "<LI><A HREF=\"#cp"
                        + name_index + "\">NameAndType index(" + name_index + ")</A></UL>");
                break;
            case CONSTANT_Fieldref:
                // Get class_index and name_and_type_index
                ConstantFieldref c3 = (ConstantFieldref) constant_pool.getConstant(index,
                        CONSTANT_Fieldref);
                class_index = c3.getClassIndex();
                name_index = c3.getNameAndTypeIndex();
                // Get method name and its class (compacted)
                String field_class = constant_pool.constantToString(class_index, CONSTANT_Class);
                String short_field_class = Utility.compactClassName(field_class); // I.e., remove java.lang.
                short_field_class = Utility.compactClassName(short_field_class,
                        class_package + ".", true); // Remove class package prefix
View Full Code Here

                        break;
                    }
                }
            }
            else if(c instanceof ConstantFieldref){
                ConstantFieldref fieldC = (ConstantFieldref)c;
                String path = fieldC.getClass(cp) + "." +
                        ((ConstantNameAndType)cp.getConstant(
                                fieldC.getNameAndTypeIndex())).getName(cp);
                for(Key key : keys){
                    if(key.matches(path, KeyType.FIELD)){
                        ret.add(key.assoc);
                        break;
                    }
View Full Code Here

            case GETFIELD:
            case GETSTATIC:
            case PUTFIELD:
            case PUTSTATIC:
                index = bytes.readShort();
                ConstantFieldref c1 = (ConstantFieldref) constant_pool.getConstant(index,
                        CONSTANT_Fieldref);
                class_index = c1.getClassIndex();
                name = constant_pool.getConstantString(class_index, CONSTANT_Class);
                name = Utility.compactClassName(name, false);
                index = c1.getNameAndTypeIndex();
                String field_name = constant_pool.constantToString(index, CONSTANT_NameAndType);
                if (name.equals(class_name)) { // Local field
                    buf.append("<A HREF=\"").append(class_name).append("_methods.html#field")
                            .append(field_name).append("\" TARGET=Methods>").append(field_name)
                            .append("</A>\n");
View Full Code Here

TOP

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

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.