Package org.apache.bcel.classfile

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


    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

        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

TOP

Related Classes of org.apache.bcel.classfile.ArrayElementValue

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.