@Override public void visitEnd() { String ename = name; if (ename == null) { ename = "default"; } AnnotationElemBuilder.this.elems.add(new AnnotationArrayElem(this.elems, '[', ename)); } };
@Override public void caseAnnotationArrayElem(AnnotationArrayElem v) { /* * for arrays, apply a new AnnotationElemSwitch to every array element and collect the results. Note that the component * type of the result is unknown here, s.t. object has to be used. */ Object[] result = new Object[v.getNumValues()]; int i = 0; for (AnnotationElem elem : v.getValues()) { AnnotationElemSwitch sw = new AnnotationElemSwitch(); elem.apply(sw); result[i] = ((AnnotationElemResult<?>) sw.getResult()).getValue(); i++; } setResult(new AnnotationElemResult<Object[]>(v.getName(), result)); }
AnnotationArrayElem arrayElem = (AnnotationArrayElem) elem; result.append("\n"); for (int i = 0; i < arrayElem.getNumValues(); i++) { result.append(getElemAttr(arrayElem.getValueAt(i)));
} else if (elem instanceof AnnotationArrayElem) { AnnotationArrayElem arrayElem = (AnnotationArrayElem) elem; AnnotationVisitor arrayVisitor = av.visitArray(arrayElem.getName()); generateAnnotationElems(arrayVisitor, arrayElem.getValues(), false); } else if (elem instanceof AnnotationAnnotationElem) { AnnotationAnnotationElem aElem = (AnnotationAnnotationElem) elem;
case DALVIK_ANNOTATION_MEMBERCLASSES: AnnotationArrayElem arre = (AnnotationArrayElem) getElements(a.getElements()).get(0); for (AnnotationElem ae : arre.getValues()) { AnnotationClassElem c = (AnnotationClassElem) ae; String innerClass = c.getDesc(); for (AnnotationElem ae : arre.getValues()) { AnnotationStringElem s = (AnnotationStringElem) ae; sig += s.getValue();
if (array.getNumValues() > 0) { AnnotationElem firstElement = array.getValueAt(0); Type type = getSootType(firstElement); if (type == null) {
@Override public AnnotationVisitor visitArray(final String name) { return new AnnotationElemBuilder() { @Override public void visitEnd() { String ename = name; if (ename == null) { ename = "default"; } AnnotationElemBuilder.this.elems.add(new AnnotationArrayElem(this.elems, '[', ename)); } }; }
AnnotationArrayElem e = (AnnotationArrayElem) elem; List<EncodedValue> values = new ArrayList<EncodedValue>(); for (int i = 0; i < e.getNumValues(); i++) { EncodedValue val = buildEncodedValueForAnnotation(e.getValueAt(i)); values.add(val);
/** * @ast method * @aspect AnnotationsCodegen * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:359 */ public void appendAsAttributeTo(Collection list, String name) { ArrayList elemVals = new ArrayList(); for(int i = 0; i < getNumElementValue(); i++) getElementValue(i).appendAsAttributeTo(elemVals, "default"); list.add(new soot.tagkit.AnnotationArrayElem(elemVals, '[', name)); } /**
throw new UnsupportedOperationException("Unsupported array value type: " + value.getClass()); elem = new AnnotationArrayElem(annotationArray, '[', name); } else { throw new UnsupportedOperationException("Unsupported value type: " + value.getClass());
AnnotationArrayElem elem = new AnnotationArrayElem(elemVals, kind, elemName); list.add(elem); } else if (kind == '@') {
AnnotationElem elem = new AnnotationArrayElem(sigElements, '[', "value"); vat = new AnnotationTag("Ldalvik/annotation/Signature;", Collections.singleton(elem)); } else {
ArrayList<AnnotationElem> l = handleAnnotationElement(ae, v.getValue()); if (l != null) { elem = new AnnotationArrayElem(l, '[', ae.getName());
AnnotationArrayElem elem = new AnnotationArrayElem(elemVals, kind, elemName); list.add(elem);
AnnotationArrayElem elem = new AnnotationArrayElem(elemVals, kind, elemName); list.add(elem);