Package org.aspectj.apache.bcel.classfile

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


  /**
   * @return signature of referenced method/field.
   */
  public String getSignature(ConstantPool cp) {
    if (signature == null) {
      ConstantCP cmr = (ConstantCP) cp.getConstant(index);
      ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex());
      signature = ((ConstantUtf8) cp.getConstant(cnat.getSignatureIndex())).getValue();
    }
    return signature;
  }
View Full Code Here


  /**
   * @return name of referenced method/field.
   */
  public String getName(ConstantPool cp) {
    if (name == null) {
      ConstantCP cmr = (ConstantCP) cp.getConstant(index);
      ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex());
      name = ((ConstantUtf8) cp.getConstant(cnat.getNameIndex())).getValue();
    }
    return name;
  }
View Full Code Here

  /**
   * @return name of the referenced class/interface
   */
  public String getClassName(ConstantPool cp) {
    if (classname == null) {
      ConstantCP cmr = (ConstantCP) cp.getConstant(index);
      String str = cp.getConstantString(cmr.getClassIndex(), CONSTANT_Class);
      if (str.charAt(0) == '[') {
        classname = str;
      } else {
        classname = str.replace('/', '.');
      }
View Full Code Here

  /** @return signature of referenced method/field.
   */
  public String getSignature(ConstantPoolGen cpg) {
    ConstantPool        cp   = cpg.getConstantPool();
    ConstantCP          cmr  = (ConstantCP)cp.getConstant(index);
    ConstantNameAndType cnat = (ConstantNameAndType)cp.getConstant(cmr.getNameAndTypeIndex());

    return ((ConstantUtf8)cp.getConstant(cnat.getSignatureIndex())).getBytes();
  }
View Full Code Here

  /** @return name of referenced method/field.
   */
  public String getName(ConstantPoolGen cpg) {
    ConstantPool        cp   = cpg.getConstantPool();
    ConstantCP          cmr  = (ConstantCP)cp.getConstant(index);
    ConstantNameAndType cnat = (ConstantNameAndType)cp.getConstant(cmr.getNameAndTypeIndex());
    return ((ConstantUtf8)cp.getConstant(cnat.getNameIndex())).getBytes();
  }
View Full Code Here

  /** @return name of the referenced class/interface
   */
  public String getClassName(ConstantPoolGen cpg) {
    ConstantPool cp  = cpg.getConstantPool();
    ConstantCP   cmr = (ConstantCP)cp.getConstant(index);
    String str = cp.getConstantString(cmr.getClassIndex(), org.aspectj.apache.bcel.Constants.CONSTANT_Class);
    if (str.charAt(0)=='[') return str;
    else return str.replace('/', '.');
  }
View Full Code Here

       } else if(c instanceof ConstantUtf8) {
         ConstantUtf8 u = (ConstantUtf8)c;
        
         utf8_table.put(u.getBytes(), new Index(i));
      } else if(c instanceof ConstantCP) {
  ConstantCP          m     = (ConstantCP)c;
  ConstantClass       clazz = (ConstantClass)constants[m.getClassIndex()];
  ConstantNameAndType n     = (ConstantNameAndType)constants[m.getNameAndTypeIndex()];
 
        ConstantUtf8 u8         = (ConstantUtf8)constants[clazz.getNameIndex()];
        String       class_name = u8.getBytes().replace('/', '.');

  u8 = (ConstantUtf8)constants[n.getNameIndex()];
View Full Code Here

    case Constants.CONSTANT_Integer:
      return addInteger(((ConstantInteger)c).getBytes());

    case Constants.CONSTANT_InterfaceMethodref: case Constants.CONSTANT_Methodref:
    case Constants.CONSTANT_Fieldref: {
      ConstantCP          m     = (ConstantCP)c;
      ConstantClass       clazz = (ConstantClass)constants[m.getClassIndex()];
      ConstantNameAndType n     = (ConstantNameAndType)constants[m.getNameAndTypeIndex()];
      ConstantUtf8 u8           = (ConstantUtf8)constants[clazz.getNameIndex()];
      String       class_name   = u8.getBytes().replace('/', '.');

      u8 = (ConstantUtf8)constants[n.getNameIndex()];
      String name = u8.getBytes();
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.classfile.ConstantCP

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.