Package org.aspectj.apache.bcel.classfile.annotation

Examples of org.aspectj.apache.bcel.classfile.annotation.EnumElementValue


        boolean doneAndDusted = false;
        for (Iterator<NameValuePair> iterator = vals.iterator(); iterator.hasNext();) {
          NameValuePair object = iterator.next();
          Object o = object.getValue();
          if (o instanceof EnumElementValue) {
            EnumElementValue v = (EnumElementValue) object.getValue();
            String s = v.getEnumTypeString();
            ResolvedType rt = toType.getWorld().resolve(UnresolvedType.forSignature(s));
            if (rt.equals(toType)) {
              il.append(fact.createGetStatic(rt.getName(), v.getEnumValueString(), Type.getType(rt.getSignature())));
              doneAndDusted = true;
            }
          } else if (o instanceof SimpleElementValue) {
            // FIXASC types other than String will go bang bang at runtime
            SimpleElementValue v = (SimpleElementValue) object.getValue();
            il.append(fact.createConstant(v.getValueString()));
            doneAndDusted = true;
            // String s = v.getEnumTypeString();
            // ResolvedType rt = toType.getWorld().resolve(UnresolvedType.forSignature(s));
            // if (rt.equals(toType)) {
            // il.append(fact.createGetStatic(rt.getName(), v.getEnumValueString(), Type.getType(rt.getSignature())));
View Full Code Here


          AnnotationAJ ax = annotations[i];
          if (ax.getTypeName().equals(UnresolvedType.AT_RETENTION.getName())) {
            List<NameValuePair> values = ((BcelAnnotation) ax).getBcelAnnotation().getValues();
            for (Iterator<NameValuePair> it = values.iterator(); it.hasNext();) {
              NameValuePair element = it.next();
              EnumElementValue v = (EnumElementValue) element.getValue();
              retentionPolicy = v.getEnumValueString();
              return retentionPolicy;
            }
          }
        }
      }
View Full Code Here

          ElementValue o = nvp.getValue();
          if (o.getElementValueType() != elementValueType) {
            continue;
          }
          if (o instanceof EnumElementValue) {
            EnumElementValue v = (EnumElementValue) o;
            String s = v.getEnumTypeString();
            ResolvedType rt = toType.getWorld().resolve(UnresolvedType.forSignature(s));
            if (rt.equals(toType)) {
              il.append(fact.createGetStatic(rt.getName(), v.getEnumValueString(), Type.getType(rt.getSignature())));
              foundValueInAnnotationUsage = true;
            }
          } else if (o instanceof SimpleElementValue) {
            SimpleElementValue v = (SimpleElementValue) o;
            switch (v.getElementValueType()) {
            case ElementValue.PRIMITIVE_INT:
              il.append(fact.createConstant(v.getValueInt()));
              foundValueInAnnotationUsage = true;
              break;
            case ElementValue.STRING:
              il.append(fact.createConstant(v.getValueString()));
              foundValueInAnnotationUsage = true;
              break;
            default:
              throw new IllegalStateException("NYI: Unsupported annotation value binding for " + o);
            }
View Full Code Here

    NameValuePair envp = values.get(0);
    ArrayElementValue aev = (ArrayElementValue) envp.getValue();
    ElementValue[] evs = aev.getElementValuesArray();
    Set<String> targets = new HashSet<String>();
    for (int i = 0; i < evs.length; i++) {
      EnumElementValue ev = (EnumElementValue) evs[i];
      targets.add(ev.getEnumValueString());
    }
    return targets;
  }
View Full Code Here

          AnnotationAJ ax = annotations[i];
          if (ax.getTypeName().equals(UnresolvedType.AT_RETENTION.getName())) {
            List<NameValuePair> values = ((BcelAnnotation) ax).getBcelAnnotation().getValues();
            for (Iterator<NameValuePair> it = values.iterator(); it.hasNext();) {
              NameValuePair element = it.next();
              EnumElementValue v = (EnumElementValue) element.getValue();
              retentionPolicy = v.getEnumValueString();
              return retentionPolicy;
            }
          }
        }
      }
View Full Code Here

    NameValuePair envp = values.get(0);
    ArrayElementValue aev = (ArrayElementValue) envp.getValue();
    ElementValue[] evs = aev.getElementValuesArray();
    Set<String> targets = new HashSet<String>();
    for (int i = 0; i < evs.length; i++) {
      EnumElementValue ev = (EnumElementValue) evs[i];
      targets.add(ev.getEnumValueString());
    }
    return targets;
  }
View Full Code Here

  /**
     * Return immutable variant of this EnumElementValue
     */
  public ElementValue getElementValue() {
    System.err.println("Duplicating value: "+getEnumTypeString()+":"+getEnumValueString());
    return new EnumElementValue(type,typeIdx,valueIdx,cpGen.getConstantPool());
  }
View Full Code Here

        List values = atTargetAnnotation.getBcelAnnotation().getValues();
          ElementNameValuePair envp = (ElementNameValuePair)values.get(0);
          ArrayElementValue aev = (ArrayElementValue)envp.getValue();
          ElementValue[] evs = aev.getElementValuesArray();
          for (int i = 0; i < evs.length; i++) {
          EnumElementValue ev = (EnumElementValue)evs[i];
          supportedTargets.add(ev.getEnumValueString());
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.classfile.annotation.EnumElementValue

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.