private static void appendAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType) { Set<String> filter = new HashSet<>(); for (StructGeneralAttribute.Key<?> key : ANNOTATION_ATTRIBUTES) { StructAnnotationAttribute attribute = (StructAnnotationAttribute)mb.getAttribute(key); if (attribute != null) { for (AnnotationExprent annotation : attribute.getAnnotations()) { String text = annotation.toJava(indent, BytecodeMappingTracer.DUMMY).toString(); filter.add(text); buffer.append(text).appendLineSeparator(); } } } appendTypeAnnotations(buffer, indent, mb, targetType, -1, filter); }
private static void appendTypeAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType, int index, Set<String> filter) { for (StructGeneralAttribute.Key<?> key : TYPE_ANNOTATION_ATTRIBUTES) { StructTypeAnnotationAttribute attribute = (StructTypeAnnotationAttribute)mb.getAttribute(key); if (attribute != null) { for (TypeAnnotation annotation : attribute.getAnnotations()) { if (annotation.isTopLevel() && annotation.getTargetType() == targetType && (index < 0 || annotation.getIndex() == index)) { String text = annotation.getAnnotation().toJava(indent, BytecodeMappingTracer.DUMMY).toString(); if (!filter.contains(text)) { buffer.append(text); if (indent < 0) { buffer.append(' '); } else { buffer.appendLineSeparator(); } } } } } } }
private static void appendAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType) { Set<String> filter = new HashSet<>(); for (String name : ANNOTATION_ATTRIBUTES) { StructAnnotationAttribute attribute = (StructAnnotationAttribute)mb.getAttribute(name); if (attribute != null) { for (AnnotationExprent annotation : attribute.getAnnotations()) { String text = annotation.toJava(indent, BytecodeMappingTracer.DUMMY).toString(); filter.add(text); buffer.append(text).appendLineSeparator(); } } } appendTypeAnnotations(buffer, indent, mb, targetType, -1, filter); }
private static void appendTypeAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType, int index, Set<String> filter) { for (String name : TYPE_ANNOTATION_ATTRIBUTES) { StructTypeAnnotationAttribute attribute = (StructTypeAnnotationAttribute)mb.getAttribute(name); if (attribute != null) { for (TypeAnnotation annotation : attribute.getAnnotations()) { if (annotation.isTopLevel() && annotation.getTargetType() == targetType && (index < 0 || annotation.getIndex() == index)) { String text = annotation.getAnnotation().toJava(indent, BytecodeMappingTracer.DUMMY).toString(); if (!filter.contains(text)) { buffer.append(text); if (indent < 0) { buffer.append(' '); } else { buffer.appendLineSeparator(); } } } } } } }