Examples of ConstantUtf8


Examples of org.apache.bcel.classfile.ConstantUtf8

            boolean addInterface = true;

            for (int l = 0; l < interfaces.length; l++) {
                ConstantClass cc = (ConstantClass)cpg.getConstant(interfaces[l]);
                ConstantUtf8 cu = (ConstantUtf8)cpg.getConstant(cc.getNameIndex());

                if (implementsInterface(cu, interfaceName)) {
                    addInterface = false;
                    break;
                }
View Full Code Here

Examples of org.apache.tomcat.util.bcel.classfile.ConstantUtf8

     */
    public static final Attribute readAttribute(DataInputStream file,
            ConstantPool constant_pool) throws IOException,
            ClassFormatException
    {
        ConstantUtf8 c;
        String name;
        int name_index;
        int length;
        byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
        // Get class name from constant pool via `name_index' indirection
        name_index = file.readUnsignedShort();
        c = (ConstantUtf8) constant_pool.getConstant(name_index,
                Constants.CONSTANT_Utf8);
        name = c.getBytes();
        // Length of data in bytes
        length = file.readInt();
        // Compare strings to find known attribute
        // System.out.println(name);
        for (byte i = 0; i < Constants.KNOWN_ATTRIBUTES; i++)
View Full Code Here

Examples of org.apache.tomcat.util.bcel.classfile.ConstantUtf8

    /**
     * @return Name of attribute
     */
    public String getName()
    {
        ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index,
                Constants.CONSTANT_Utf8);
        return c.getBytes();
    }
View Full Code Here

Examples of org.apache.tomcat.util.bcel.classfile.ConstantUtf8

   */
  public static final Attribute readAttribute(DataInputStream file,
      ConstantPool constant_pool) throws IOException,
      ClassFormatException
  {
    ConstantUtf8 c;
    String name;
    int name_index;
    int length;
    byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
    // Get class name from constant pool via `name_index' indirection
    name_index = file.readUnsignedShort();
    c = (ConstantUtf8) constant_pool.getConstant(name_index,
        Constants.CONSTANT_Utf8);
    name = c.getBytes();
    // Length of data in bytes
    length = file.readInt();
    // Compare strings to find known attribute
    // System.out.println(name);
    for (byte i = 0; i < Constants.KNOWN_ATTRIBUTES; i++)
View Full Code Here

Examples of org.apache.tomcat.util.bcel.classfile.ConstantUtf8

  /**
   * @return Name of attribute
   */
  public String getName()
  {
    ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index,
        Constants.CONSTANT_Utf8);
    return c.getBytes();
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.ConstantUtf8

  public String getValueString() {
    if (type != STRING) {
      throw new RuntimeException("Dont call getValueString() on a non STRING ElementValue");
    }
    ConstantUtf8 c = (ConstantUtf8) cpool.getConstant(idx);
    return c.getValue();
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.ConstantUtf8

        return "false";
      } else {
        return "true";
      }
    case STRING:
      ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(idx);
      return cu8.getValue();

    default:
      throw new RuntimeException("SimpleElementValueGen class does not know how to stringify type " + type);
    }
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.ConstantUtf8

      } else {
        s.append("true");
      }
      break;
    case STRING:
      ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(idx);
      s.append("(string)").append(cu8.getValue());
      break;
    default:
      throw new RuntimeException("SimpleElementValueGen class does not know how to stringify type " + type);
    }
    return s.toString();
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.ConstantUtf8

   * return signature and value, something like Lp/Color;RED
   */
  @Override
  public String stringifyValue() {
    StringBuffer sb = new StringBuffer();
    ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(typeIdx, Constants.CONSTANT_Utf8);
    sb.append(cu8.getValue());
    cu8 = (ConstantUtf8) cpool.getConstant(valueIdx, Constants.CONSTANT_Utf8);
    sb.append(cu8.getValue());
    return sb.toString();
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.ConstantUtf8

  public int getIndex() {
    return idx;
  }

  public String getClassString() {
    ConstantUtf8 cu8 = (ConstantUtf8) getConstantPool().getConstant(idx);
    return cu8.getValue();
    // ConstantClass c = (ConstantClass)getConstantPool().getConstant(idx);
    // ConstantUtf8 utf8 = (ConstantUtf8)getConstantPool().getConstant(c.getNameIndex());
    // return utf8.getBytes();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.