Examples of ArrayElementValue


Examples of org.apache.bcel.classfile.ArrayElementValue

    @CheckForNull
    @SuppressFBWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
    protected static String[] getAnnotationParameterAsStringArray(Map<String, ElementValue> map, String parameter) {
        try {
            ElementValue e = map.get(parameter);
            ArrayElementValue a = (ArrayElementValue) e;
            int size = a.getElementValuesArraySize();
            String[] result = new String[size];
            ElementValue[] elementValuesArray = a.getElementValuesArray();
            for (int i = 0; i < size; i++) {
                result[i] = ((SimpleElementValue) elementValuesArray[i]).getValueString();
            }
            return result;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.bcel.classfile.ArrayElementValue

    ElementValue[] immutableData = new ElementValue[evalues.size()];
    int i = 0;
    for (ElementValueGen element : evalues) {
      immutableData[i++] = element.getElementValue();
    }
    return new ArrayElementValue(type, immutableData, cpGen
        .getConstantPool());
  }
View Full Code Here

Examples of org.apache.bcel.classfile.ArrayElementValue

        else if(ev instanceof AnnotationElementValue)
            length += getLength(((AnnotationElementValue)ev).
                    getAnnotationEntry());
        else if(ev instanceof ArrayElementValue){
            length += 2; // num_values
            ArrayElementValue aev = (ArrayElementValue)ev;
            for(ElementValue ev2 : aev.getElementValuesArray())
                length += getLength(ev2);
        }
       
        return length;
    }
View Full Code Here

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

        List<NameValuePair> vals = ((BcelAnnotation) anns[i]).getBcelAnnotation().getValues();
        if (vals == null || vals.isEmpty()) { // (1)
          suppressedWarnings.addAll(lint.allKinds());
        } else { // (2)
          // We know the value is an array value
          ArrayElementValue array = (ArrayElementValue) (vals.get(0)).getValue();
          ElementValue[] values = array.getElementValuesArray();
          for (int j = 0; j < values.length; j++) {
            // We know values in the array are strings
            SimpleElementValue value = (SimpleElementValue) values[j];
            Lint.Kind lintKind = lint.getLintKind(value.getValueString());
            if (lintKind != null) {
View Full Code Here

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

    NameValuePair interfaceListSpecified = getAnnotationElement(declareMixinAnnotation, "interfaces");

    List<TypePattern> newParents = new ArrayList<TypePattern>(1);
    List<ResolvedType> newInterfaceTypes = new ArrayList<ResolvedType>(1);
    if (interfaceListSpecified != null) {
      ArrayElementValue arrayOfInterfaceTypes = (ArrayElementValue) interfaceListSpecified.getValue();
      int numberOfTypes = arrayOfInterfaceTypes.getElementValuesArraySize();
      ElementValue[] theTypes = arrayOfInterfaceTypes.getElementValuesArray();
      for (int i = 0; i < numberOfTypes; i++) {
        ClassElementValue interfaceType = (ClassElementValue) theTypes[i];
        // Check: needs to be resolvable
        // TODO crappy replace required
        ResolvedType ajInterfaceType = UnresolvedType.forSignature(interfaceType.getClassString().replace("/", "."))
View Full Code Here

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

        List<NameValuePair> vals = ((BcelAnnotation) anns[i]).getBcelAnnotation().getValues();
        if (vals == null || vals.isEmpty()) { // (1)
          suppressedWarnings.addAll(lint.allKinds());
        } else { // (2)
          // We know the value is an array value
          ArrayElementValue array = (ArrayElementValue) (vals.get(0)).getValue();
          ElementValue[] values = array.getElementValuesArray();
          for (int j = 0; j < values.length; j++) {
            // We know values in the array are strings
            SimpleElementValue value = (SimpleElementValue) values[j];
            Lint.Kind lintKind = lint.getLintKind(value.getValueString());
            if (lintKind != null) {
View Full Code Here

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

    if (!type.equals(UnresolvedType.AT_TARGET)) {
      return Collections.emptySet();
    }
    List<NameValuePair> values = bcelAnnotation.getValues();
    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());
    }
View Full Code Here

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

    NameValuePair interfaceListSpecified = getAnnotationElement(declareMixinAnnotation, "interfaces");

    List<TypePattern> newParents = new ArrayList<TypePattern>(1);
    List<ResolvedType> newInterfaceTypes = new ArrayList<ResolvedType>(1);
    if (interfaceListSpecified != null) {
      ArrayElementValue arrayOfInterfaceTypes = (ArrayElementValue) interfaceListSpecified.getValue();
      int numberOfTypes = arrayOfInterfaceTypes.getElementValuesArraySize();
      ElementValue[] theTypes = arrayOfInterfaceTypes.getElementValuesArray();
      for (int i = 0; i < numberOfTypes; i++) {
        ClassElementValue interfaceType = (ClassElementValue) theTypes[i];
        // Check: needs to be resolvable
        // TODO crappy replace required
        ResolvedType ajInterfaceType = UnresolvedType.forSignature(interfaceType.getClassString().replace("/", "."))
View Full Code Here

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

    NameValuePair interfaceListSpecified = getAnnotationElement(declareMixinAnnotation, "interfaces");

    List<TypePattern> newParents = new ArrayList<TypePattern>(1);
    List<ResolvedType> newInterfaceTypes = new ArrayList<ResolvedType>(1);
    if (interfaceListSpecified != null) {
      ArrayElementValue arrayOfInterfaceTypes = (ArrayElementValue) interfaceListSpecified.getValue();
      int numberOfTypes = arrayOfInterfaceTypes.getElementValuesArraySize();
      ElementValue[] theTypes = arrayOfInterfaceTypes.getElementValuesArray();
      for (int i = 0; i < numberOfTypes; i++) {
        ClassElementValue interfaceType = (ClassElementValue) theTypes[i];
        // Check: needs to be resolvable
        // TODO crappy replace required
        ResolvedType ajInterfaceType = UnresolvedType.forSignature(interfaceType.getClassString().replace("/", "."))
View Full Code Here

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

    if (!type.equals(UnresolvedType.AT_TARGET)) {
      return Collections.emptySet();
    }
    List<NameValuePair> values = bcelAnnotation.getValues();
    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());
    }
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.