public class AnnotationRemapper extends AnnotationVisitor
AnnotationVisitor
that remaps types with a Remapper
.Modifier and Type | Field and Description |
---|---|
protected Remapper |
remapper
The remapper used to remap the types in the visited annotation.
|
api, av
Modifier | Constructor and Description |
---|---|
|
AnnotationRemapper(AnnotationVisitor annotationVisitor,
Remapper remapper)
Constructs a new
AnnotationRemapper . |
protected |
AnnotationRemapper(int api,
AnnotationVisitor annotationVisitor,
Remapper remapper)
Constructs a new
AnnotationRemapper . |
Modifier and Type | Method and Description |
---|---|
protected AnnotationVisitor |
createAnnotationRemapper(AnnotationVisitor annotationVisitor)
Constructs a new remapper for annotations.
|
void |
visit(String name,
Object value)
Visits a primitive value of the annotation.
|
AnnotationVisitor |
visitAnnotation(String name,
String descriptor)
Visits a nested annotation value of the annotation.
|
AnnotationVisitor |
visitArray(String name)
Visits an array value of the annotation.
|
void |
visitEnum(String name,
String descriptor,
String value)
Visits an enumeration value of the annotation.
|
visitEnd
protected final Remapper remapper
public AnnotationRemapper(AnnotationVisitor annotationVisitor, Remapper remapper)
AnnotationRemapper
. Subclasses must not use this constructor.
Instead, they must use the AnnotationRemapper(int,AnnotationVisitor,Remapper)
version.annotationVisitor
- the annotation visitor this remapper must deleted to.remapper
- the remapper to use to remap the types in the visited annotation.protected AnnotationRemapper(int api, AnnotationVisitor annotationVisitor, Remapper remapper)
AnnotationRemapper
.api
- the ASM API version supported by this remapper. Must be one of Opcodes.ASM4
, Opcodes.ASM5
, Opcodes.ASM6
, Opcodes.ASM7
or Opcodes.ASM8
annotationVisitor
- the annotation visitor this remapper must deleted to.remapper
- the remapper to use to remap the types in the visited annotation.public void visit(String name, Object value)
AnnotationVisitor
visit
in class AnnotationVisitor
name
- the value name.value
- the actual value, whose type must be Byte
, Boolean
, Character
, Short
, Integer
, Long
, Float
, Double
,
String
or Type
of Type.OBJECT
or Type.ARRAY
sort. This
value can also be an array of byte, boolean, short, char, int, long, float or double values
(this is equivalent to using AnnotationVisitor.visitArray(java.lang.String)
and visiting each array element in turn,
but is more convenient).public void visitEnum(String name, String descriptor, String value)
AnnotationVisitor
visitEnum
in class AnnotationVisitor
name
- the value name.descriptor
- the class descriptor of the enumeration class.value
- the actual enumeration value.public AnnotationVisitor visitAnnotation(String name, String descriptor)
AnnotationVisitor
visitAnnotation
in class AnnotationVisitor
name
- the value name.descriptor
- the class descriptor of the nested annotation class.public AnnotationVisitor visitArray(String name)
AnnotationVisitor
visit
. This is what ClassReader
does.visitArray
in class AnnotationVisitor
name
- the value name.protected AnnotationVisitor createAnnotationRemapper(AnnotationVisitor annotationVisitor)
AnnotationRemapper
.annotationVisitor
- the AnnotationVisitor the remapper must delegate to.Copyright © 2023. All rights reserved.