public class DeclarationAnnotationHelper
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
DeclarationAnnotationHelper.ArrayCountingIterator |
static class |
DeclarationAnnotationHelper.DeclarationAnnotationsInfo
Represents information about where to place declaration and
ElementType.TYPE_USE
annotations for a place where both can occur. |
private static class |
DeclarationAnnotationHelper.NestedCountingIterator |
private static class |
DeclarationAnnotationHelper.SinglePartTypeIterator |
| Modifier and Type | Field and Description |
|---|---|
private static DecompilerComments |
EMPTY_DECOMPILER_COMMENTS |
| Modifier | Constructor and Description |
|---|---|
private |
DeclarationAnnotationHelper() |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
areAnnotationsEqual(java.util.List<AnnotationTableEntry> declAnnotations,
java.util.List<AnnotationTableTypeEntry> typeAnnotations) |
private static boolean |
canTypeAnnotationBeMovedToDecl(JavaTypeInstance annotatedType,
AnnotationTableTypeEntry typeAnnotation,
java.lang.Integer commonInnerAnnotationIndex)
Returns whether the type annotation can be moved to the declaration.
|
private static java.lang.Integer |
getCommonInnerClassAnnotationIndex(java.util.List<AnnotationTableTypeEntry> typeAnnotations)
Returns for the annotations the common inner class annotation index, or
null
if there is no common index. |
private static java.util.Set<JavaTypeInstance> |
getDeclAndTypeUseAnnotationTypes(java.util.List<AnnotationTableEntry> declAnnotations,
java.util.List<AnnotationTableTypeEntry> typeAnnotations) |
static DeclarationAnnotationHelper.DeclarationAnnotationsInfo |
getDeclarationInfo(JavaTypeInstance nullableAnnotatedType,
java.util.List<AnnotationTableEntry> declarationAnnotations,
java.util.List<AnnotationTableTypeEntry> typeAnnotations)
Calculates information about where to place declaration and
ElementType.TYPE_USE
annotations for a place where both can occur. |
private static final DecompilerComments EMPTY_DECOMPILER_COMMENTS
private static java.util.Set<JavaTypeInstance> getDeclAndTypeUseAnnotationTypes(java.util.List<AnnotationTableEntry> declAnnotations, java.util.List<AnnotationTableTypeEntry> typeAnnotations)
private static java.lang.Integer getCommonInnerClassAnnotationIndex(java.util.List<AnnotationTableTypeEntry> typeAnnotations)
null
if there is no common index. For example with A and B being inner classes:
{@codetypeAnnotations - For which the common inner annotation index should be determinednullprivate static boolean canTypeAnnotationBeMovedToDecl(JavaTypeInstance annotatedType, AnnotationTableTypeEntry typeAnnotation, java.lang.Integer commonInnerAnnotationIndex)
{@code
// Can be moved
public @TypeUse String[] f;
// when moved:annotatedType - Type to be annotatedtypeAnnotation - Annotation for the typecommonInnerAnnotationIndex - Nullable index of the common annotation position for inner classesprivate static boolean areAnnotationsEqual(java.util.List<AnnotationTableEntry> declAnnotations, java.util.List<AnnotationTableTypeEntry> typeAnnotations)
public static DeclarationAnnotationHelper.DeclarationAnnotationsInfo getDeclarationInfo(JavaTypeInstance nullableAnnotatedType, java.util.List<AnnotationTableEntry> declarationAnnotations, java.util.List<AnnotationTableTypeEntry> typeAnnotations)
ElementType.TYPE_USE
annotations for a place where both can occur.nullableAnnotatedType - Type for which the TYPE_USE annotations apply, null if there is no
type (e.g. for constructor declarations)declarationAnnotations - Annotations for the declaration, e.g. ElementType.FIELDtypeAnnotations - Annotations for the type, i.e. ElementType.TYPE_USE