Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.ConstantInterfaceMethodref


    int count = o.getCount();
    if (count == 0){
      constraintViolated(o, "The 'count' argument must not be 0.");
    }
    // It is a ConstantInterfaceMethodref, Pass 3a made it sure.
    ConstantInterfaceMethodref cimr = (ConstantInterfaceMethodref) (cpg.getConstant(o.getIndex()));
   
    // the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o).

    Type t = o.getType(cpg);
    if (t instanceof ObjectType){
View Full Code Here


                ConstantMethodref cmr = (ConstantMethodref) constant;

                int classIndex = cmr.getClassIndex();
                className = jclass.getConstantPool().getConstantString(classIndex, Constants.CONSTANT_Class);
            } else if (constant instanceof ConstantInterfaceMethodref) {
                ConstantInterfaceMethodref cmr = (ConstantInterfaceMethodref) constant;

                int classIndex = cmr.getClassIndex();
                className = jclass.getConstantPool().getConstantString(classIndex, Constants.CONSTANT_Class);
            }

            if (className != null) {
                if (DEBUG) {
View Full Code Here

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

                int m_index = bytes.readShort();
                String str;
                if (opcode == INVOKEINTERFACE) { // Special treatment needed
                    int nargs = bytes.readUnsignedByte(); // Redundant
                    int reserved = bytes.readUnsignedByte(); // Reserved
                    ConstantInterfaceMethodref c = (ConstantInterfaceMethodref) constant_pool
                            .getConstant(m_index, CONSTANT_InterfaceMethodref);
                    class_index = c.getClassIndex();
                    str = constant_pool.constantToString(c);
                    index = c.getNameAndTypeIndex();
                } else {
                    ConstantMethodref c = (ConstantMethodref) constant_pool.getConstant(m_index,
                            CONSTANT_Methodref);
                    class_index = c.getClassIndex();
                    str = constant_pool.constantToString(c);
                    index = c.getNameAndTypeIndex();
                }
                name = Class2HTML.referenceClass(class_index);
                str = Class2HTML.toHTML(constant_pool.constantToString(constant_pool.getConstant(
                        index, CONSTANT_NameAndType)));
                // Get signature, i.e., types
View Full Code Here

                    ConstantMethodref c = (ConstantMethodref) constant_pool.getConstant(index,
                            CONSTANT_Methodref);
                    class_index = c.getClassIndex();
                    name_index = c.getNameAndTypeIndex();
                } else {
                    ConstantInterfaceMethodref c1 = (ConstantInterfaceMethodref) constant_pool
                            .getConstant(index, CONSTANT_InterfaceMethodref);
                    class_index = c1.getClassIndex();
                    name_index = c1.getNameAndTypeIndex();
                }
                // Get method name and its class
                String method_name = constant_pool.constantToString(name_index,
                        CONSTANT_NameAndType);
                String html_method_name = Class2HTML.toHTML(method_name);
View Full Code Here

                    result.append(c.getNameAndTypeIndex());
                    result.append(";\t//  ");
                    result.append(Utility.replace(
                            constPool.constantToString(c), " ", ":"));
                } else if (constant instanceof ConstantInterfaceMethodref) {
                    ConstantInterfaceMethodref c = (ConstantInterfaceMethodref) constant;
                    result.append("InterfaceMethod\t#");
                    result.append(c.getClassIndex());
                    result.append(".#");
                    result.append(c.getNameAndTypeIndex());
                    result.append(";\t//  ");
                    result.append(Utility.replace(
                            constPool.constantToString(c), " ", ":"));
                } else if (constant instanceof ConstantDouble) {
                    ConstantDouble c = (ConstantDouble) constant;
                    result.append("double\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantFloat) {
                    ConstantFloat c = (ConstantFloat) constant;
                    result.append("float\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantInteger) {
                    ConstantInteger c = (ConstantInteger) constant;
                    result.append("int\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantLong) {
                    ConstantLong c = (ConstantLong) constant;
                    result.append("long\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantClass) {
                    ConstantClass c = (ConstantClass) constant;
                    result.append("class\t#");
                    result.append(c.getNameIndex());
                    result.append(";\t//  ");
                    result.append(constPool.constantToString(c));
                } else if (constant instanceof ConstantString) {
                    ConstantString c = (ConstantString) constant;
                    result.append("String\t#");
                    result.append(c.getStringIndex());
                    result.append(";\t//  ");
                    result.append(constPool.constantToString(c));
                }

                result.append(n);
View Full Code Here

                break;
            case 185: // invokeinterface
                b1 = bytecodes[++i];
                b2 = bytecodes[++i];
                index = b1 << 8 | b2;
                ConstantInterfaceMethodref cmir = (ConstantInterfaceMethodref) cp.getConstant(index);
                className = cmir.getClass(cp);
                CPMethodOrField cpIMethod = cpBands.getCPMethodOrField(cmir);
                bcIMethodRef.add(cpIMethod);
                bcCodes.add(new Integer(bytecode));
                i+= 2; // ignore count and zero fields as this can be recreated by the decompressor
                break;
View Full Code Here

                    result.append(c.getNameAndTypeIndex());
                    result.append(";\t//  ");
                    result.append(Utility.replace(
                            constPool.constantToString(c), " ", ":"));
                } else if (constant instanceof ConstantInterfaceMethodref) {
                    ConstantInterfaceMethodref c = (ConstantInterfaceMethodref) constant;
                    result.append("InterfaceMethod\t#");
                    result.append(c.getClassIndex());
                    result.append(".#");
                    result.append(c.getNameAndTypeIndex());
                    result.append(";\t//  ");
                    result.append(Utility.replace(
                            constPool.constantToString(c), " ", ":"));
                } else if (constant instanceof ConstantDouble) {
                    ConstantDouble c = (ConstantDouble) constant;
                    result.append("double\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantFloat) {
                    ConstantFloat c = (ConstantFloat) constant;
                    result.append("float\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantInteger) {
                    ConstantInteger c = (ConstantInteger) constant;
                    result.append("int\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantLong) {
                    ConstantLong c = (ConstantLong) constant;
                    result.append("long\t");
                    result.append(constPool.constantToString(c));
                    result.append(';');
                } else if (constant instanceof ConstantClass) {
                    ConstantClass c = (ConstantClass) constant;
                    result.append("class\t#");
                    result.append(c.getNameIndex());
                    result.append(";\t//  ");
                    result.append(constPool.constantToString(c));
                } else if (constant instanceof ConstantString) {
                    ConstantString c = (ConstantString) constant;
                    result.append("String\t#");
                    result.append(c.getStringIndex());
                    result.append(";\t//  ");
                    result.append(constPool.constantToString(c));
                }

                result.append(n);
View Full Code Here

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

                    ConstantMethodref c = (ConstantMethodref) constant_pool.getConstant(index,
                            CONSTANT_Methodref);
                    class_index = c.getClassIndex();
                    name_index = c.getNameAndTypeIndex();
                } else {
                    ConstantInterfaceMethodref c1 = (ConstantInterfaceMethodref) constant_pool
                            .getConstant(index, CONSTANT_InterfaceMethodref);
                    class_index = c1.getClassIndex();
                    name_index = c1.getNameAndTypeIndex();
                }
                // Get method name and its class
                String method_name = constant_pool.constantToString(name_index,
                        CONSTANT_NameAndType);
                String html_method_name = Class2HTML.toHTML(method_name);
View Full Code Here

TOP

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

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.