Examples of EnumElementValue


Examples of org.apache.bcel.classfile.EnumElementValue

        CheckReturnValueAnnotation n;

        if (annotationClassName.equals(javax.annotation.CheckReturnValue.class.getName())) {
            ElementValue v = map.get("when");
            if (v instanceof EnumElementValue) {
                EnumElementValue when = (EnumElementValue) v;
                String w = simpleClassName(when.getEnumValueString());
                if (w.equals("NEVER") || w.equals("UNKNOWN")) {
                    n = CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE;
                } else if (w.equals("MAYBE")) {
                    n = CheckReturnValueAnnotation.CHECK_RETURN_VALUE_MEDIUM_BAD_PRACTICE;
                } else if (w.equals("ALWAYS")) {
View Full Code Here

Examples of org.apache.bcel.classfile.EnumElementValue

    public void visitAnnotation(String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) {

        if (!annotationClass.equals("java.lang.annotation.Retention")) {
            return;
        }
        EnumElementValue v = (EnumElementValue) map.get("value");

        if ("RUNTIME".equals(v.getEnumValueString())) {
            runtimeRetention = true;
        }
    }
View Full Code Here

Examples of org.apache.bcel.classfile.EnumElementValue

  @Override
    public ElementValue getElementValue()
  {
    System.err.println("Duplicating value: " + getEnumTypeString() + ":"
        + getEnumValueString());
    return new EnumElementValue(type, typeIdx, valueIdx, cpGen
        .getConstantPool());
  }
View Full Code Here

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

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

          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

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

          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

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

    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

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

          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

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

    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

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

  /**
     * 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
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.