use of jadx.api.plugins.input.data.annotations.JadxAnnotation in project jadx by skylot.
the class JavaAnnotationsAttr method readAnnotation.
public static JadxAnnotation readAnnotation(AnnotationVisibility visibility, JavaClassData clsData, DataReader reader) {
ConstPoolReader constPool = clsData.getConstPoolReader();
String type = constPool.getUtf8(reader.readU2());
int pairsCount = reader.readU2();
Map<String, EncodedValue> pairs = new LinkedHashMap<>(pairsCount);
for (int j = 0; j < pairsCount; j++) {
String name = constPool.getUtf8(reader.readU2());
EncodedValue value = EncodedValueReader.read(clsData, reader);
pairs.put(name, value);
}
return new JadxAnnotation(visibility, type, pairs);
}
use of jadx.api.plugins.input.data.annotations.JadxAnnotation in project jadx by skylot.
the class AnnotationsParser method readAnnotation.
public static IAnnotation readAnnotation(SectionReader in, SectionReader ext, boolean readVisibility) {
AnnotationVisibility visibility = null;
if (readVisibility) {
int v = in.readUByte();
visibility = getVisibilityValue(v);
}
int typeIndex = in.readUleb128();
int size = in.readUleb128();
Map<String, EncodedValue> values = new LinkedHashMap<>(size);
for (int i = 0; i < size; i++) {
String name = ext.getString(in.readUleb128());
values.put(name, EncodedValueParser.parseValue(in, ext));
}
String type = ext.getType(typeIndex);
return new JadxAnnotation(visibility, type, values);
}
Aggregations