Package org.aspectj.apache.bcel.classfile

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


  }

// TODO setting the constant value is a mess...
  public void setValue(int index) {
    ConstantPool cp = this.cp;
    Constant c = cp.getConstant(index);
    value = ((ConstantObject) c).getConstantValue(cp);
  }
View Full Code Here


    for (InstructionHandle ih = start; ih != null; ih = ih.next) {
      Instruction i = ih.instruction;

      if (i.isConstantPoolInstruction()) {
        InstructionCP ci = (InstructionCP) i;
        Constant c = old_cp.getConstant(ci.getIndex());
        ci.setIndex(new_cp.addConstant(c, old_cp));
      }
    }
  }
View Full Code Here

    }
    boolean containsPointcut = false;
    boolean containsAnnotationClassReference = false;
    Constant[] cpool = javaClass.getConstantPool().getConstantPool();
    for (int i = 0; i < cpool.length; i++) {
      Constant constant = cpool[i];
      if (constant != null && constant.getTag() == Constants.CONSTANT_Utf8) {
        String constantValue = ((ConstantUtf8) constant).getValue();
        if (constantValue.length() > 28 && constantValue.charAt(1) == 'o') {
          if (constantValue.startsWith("Lorg/aspectj/lang/annotation")) {
            containsAnnotationClassReference = true;
            if ("Lorg/aspectj/lang/annotation/DeclareAnnotation;".equals(constantValue)) {
View Full Code Here

  }

  // TODO setting the constant value is a mess...
  public void setValue(int index) {
    ConstantPool cp = this.cp;
    Constant c = cp.getConstant(index);
    if (c instanceof ConstantInteger) {
      value = ((ConstantInteger) c).getIntValue();
    } else if (c instanceof ConstantFloat) {
      value = ((ConstantFloat) c).getValue();
    } else if (c instanceof ConstantDouble) {
View Full Code Here

  /**
   * @return mnemonic for instruction with symbolic references resolved
   */
  public String toString(ConstantPool cp) {
    Constant c = cp.getConstant(index);
    StringTokenizer tok = new StringTokenizer(cp.constantToString(c));

    return Constants.OPCODE_NAMES[opcode] + " " + tok.nextToken().replace('.', '/') + tok.nextToken();
  }
View Full Code Here

  /**
   * @return mnemonic for instruction with symbolic references resolved
   */
  public String toString(ConstantPool cp) {
    Constant c = cp.getConstant(index);
    String str = cp.constantToString(c);

    if (c instanceof ConstantClass) {
      str = str.replace('.', '/');
    }
View Full Code Here

    }
  }

  @Override
  public Object getValue(ConstantPool constantPool) {
    Constant constant = constantPool.getConstant(index);

    switch (constant.getTag()) {
    case Constants.CONSTANT_String:
      int i = ((ConstantString) constant).getStringIndex();
      constant = constantPool.getConstant(i);
      return ((ConstantUtf8) constant).getValue();
View Full Code Here

    for (InstructionHandle ih = start; ih != null; ih = ih.next) {
      Instruction i = ih.instruction;

      if (i.isConstantPoolInstruction()) {
        InstructionCP ci = (InstructionCP) i;
        Constant c = old_cp.getConstant(ci.getIndex());
        ci.setIndex(new_cp.addConstant(c, old_cp));
      }
    }
  }
View Full Code Here

    }
    boolean containsPointcut = false;
    boolean containsAnnotationClassReference = false;
    Constant[] cpool = javaClass.getConstantPool().getConstantPool();
    for (int i = 0; i < cpool.length; i++) {
      Constant constant = cpool[i];
      if (constant != null && constant.getTag() == Constants.CONSTANT_Utf8) {
        String constantValue = ((ConstantUtf8) constant).getValue();
        if (constantValue.length() > 28 && constantValue.charAt(1) == 'o') {
          if (constantValue.startsWith("Lorg/aspectj/lang/annotation")) {
            containsAnnotationClassReference = true;
            if ("Lorg/aspectj/lang/annotation/DeclareAnnotation;".equals(constantValue)) {
View Full Code Here

    }
    boolean containsPointcut = false;
    boolean containsAnnotationClassReference = false;
    Constant[] cpool = javaClass.getConstantPool().getConstantPool();
    for (int i = 0; i < cpool.length; i++) {
      Constant constant = cpool[i];
      if (constant != null && constant.getTag() == Constants.CONSTANT_Utf8) {
        String constantValue = ((ConstantUtf8) constant).getValue();
        if (constantValue.length() > 28 && constantValue.charAt(1) == 'o') {
          if (constantValue.startsWith("Lorg/aspectj/lang/annotation")) {
            containsAnnotationClassReference = true;
            if ("Lorg/aspectj/lang/annotation/DeclareAnnotation;".equals(constantValue)) {
View Full Code Here

TOP

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

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.