use of soot.tagkit.AnnotationElem in project robovm by robovm.
the class Bro method getArrayDimensions.
public static int[] getArrayDimensions(SootMethod method, int paramIndex) {
AnnotationTag annotation = paramIndex == -1 ? getArrayAnnotation(method) : getArrayAnnotation(method, paramIndex);
if (annotation == null) {
return null;
}
ArrayList<AnnotationElem> values = ((AnnotationArrayElem) annotation.getElemAt(0)).getValues();
int[] dims = new int[values.size()];
for (int i = 0; i < dims.length; i++) {
dims[i] = ((AnnotationIntElem) values.get(i)).getValue();
}
return dims;
}
use of soot.tagkit.AnnotationElem in project robovm by robovm.
the class Annotations method getMarshalerAnnotations.
public static List<AnnotationTag> getMarshalerAnnotations(SootClass clazz) {
List<AnnotationTag> tags = new ArrayList<AnnotationTag>();
AnnotationTag marshaler = getAnnotation(clazz, MARSHALER);
if (marshaler != null) {
tags.add(marshaler);
} else {
AnnotationTag marshalers = getAnnotation(clazz, MARSHALERS);
if (marshalers != null) {
for (AnnotationElem e : ((AnnotationArrayElem) marshalers.getElemAt(0)).getValues()) {
AnnotationAnnotationElem elem = (AnnotationAnnotationElem) e;
tags.add(elem.getValue());
}
}
}
return tags;
}
use of soot.tagkit.AnnotationElem in project robovm by robovm.
the class MarshalerLookup method getSupportedCallTypes.
private Set<Long> getSupportedCallTypes(AnnotationTag anno) {
AnnotationArrayElem el = (AnnotationArrayElem) getElemByName(anno, "supportedCallTypes");
if (el == null) {
return new HashSet<Long>(Arrays.asList(Bro.MarshalerFlags.CALL_TYPE_BRIDGE, Bro.MarshalerFlags.CALL_TYPE_CALLBACK, Bro.MarshalerFlags.CALL_TYPE_STRUCT_MEMBER, Bro.MarshalerFlags.CALL_TYPE_GLOBAL_VALUE, Bro.MarshalerFlags.CALL_TYPE_PTR));
}
ArrayList<AnnotationElem> values = ((AnnotationArrayElem) el).getValues();
Set<Long> callTypes = new HashSet<>();
for (AnnotationElem value : values) {
callTypes.add(((AnnotationLongElem) value).getValue());
}
return callTypes;
}
Aggregations