public class KotlinMetadataInitializer extends java.lang.Object implements ClassVisitor, AnnotationVisitor, ElementValueVisitor, ConstantVisitor
Provides two APIs:
- Visitor: use as a ClassVisitor or AnnotationVisitor to initialize the Kotlin metadata
contain within a Metadata
annotation. After initialization, all info from the
annotation is represented in the Clazz
's ProgramClass.kotlinMetadata
field.
Note: only applicable for ProgramClass
.
- `initialize`: provide the Clazz
and Metadata
field values to the
initialize(Clazz, int, int[], String[], String[], int, String,
String)
method to initialize Kotlin metadata for the given Clazz
.
Constructor and Description |
---|
KotlinMetadataInitializer(java.util.function.BiConsumer<Clazz,java.lang.String> errorHandler) |
KotlinMetadataInitializer(WarningPrinter warningPrinter) |
Modifier and Type | Method and Description |
---|---|
void |
initialize(Clazz clazz,
int k,
int[] mv,
java.lang.String[] d1,
java.lang.String[] d2,
int xi,
java.lang.String xs,
java.lang.String pn)
Initialize Kotlin metadata for a given
Clazz . |
static boolean |
isSupportedMetadataVersion(KotlinMetadataVersion mv) |
static boolean |
isValidKotlinMetadataAnnotationField(java.lang.String name) |
static KotlinMetadataType |
metadataTypeOf(java.lang.String name) |
void |
visitAnnotation(Clazz clazz,
Annotation annotation)
Visits any Annotation instance.
|
void |
visitAnyClass(Clazz clazz)
Visits any Clazz instance.
|
void |
visitArrayElementValue(Clazz clazz,
Annotation annotation,
ArrayElementValue arrayElementValue) |
void |
visitConstantElementValue(Clazz clazz,
Annotation annotation,
ConstantElementValue constantElementValue) |
void |
visitIntegerConstant(Clazz clazz,
IntegerConstant integerConstant) |
void |
visitLibraryClass(LibraryClass libraryClass) |
void |
visitProgramClass(ProgramClass clazz) |
void |
visitUtf8Constant(Clazz clazz,
Utf8Constant utf8Constant) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation
visitAnnotationElementValue, visitAnyElementValue, visitClassElementValue, visitEnumConstantElementValue
visitAnyConstant, visitAnyMethodrefConstant, visitAnyRefConstant, visitClassConstant, visitDoubleConstant, visitDynamicConstant, visitFieldrefConstant, visitFloatConstant, visitInterfaceMethodrefConstant, visitInvokeDynamicConstant, visitLongConstant, visitMethodHandleConstant, visitMethodrefConstant, visitMethodTypeConstant, visitModuleConstant, visitNameAndTypeConstant, visitPackageConstant, visitPrimitiveArrayConstant, visitStringConstant
public KotlinMetadataInitializer(WarningPrinter warningPrinter)
public KotlinMetadataInitializer(java.util.function.BiConsumer<Clazz,java.lang.String> errorHandler)
public void visitAnyClass(Clazz clazz)
ClassVisitor
visitAnyClass
in interface ClassVisitor
public void visitLibraryClass(LibraryClass libraryClass)
visitLibraryClass
in interface ClassVisitor
public void visitProgramClass(ProgramClass clazz)
visitProgramClass
in interface ClassVisitor
public void visitAnnotation(Clazz clazz, Annotation annotation)
AnnotationVisitor
visitAnnotation
in interface AnnotationVisitor
public void initialize(Clazz clazz, int k, int[] mv, java.lang.String[] d1, java.lang.String[] d2, int xi, java.lang.String xs, java.lang.String pn)
Clazz
.clazz
- The ProgramClass
or LibraryClass
.public void visitConstantElementValue(Clazz clazz, Annotation annotation, ConstantElementValue constantElementValue)
visitConstantElementValue
in interface ElementValueVisitor
public void visitArrayElementValue(Clazz clazz, Annotation annotation, ArrayElementValue arrayElementValue)
visitArrayElementValue
in interface ElementValueVisitor
public void visitUtf8Constant(Clazz clazz, Utf8Constant utf8Constant)
visitUtf8Constant
in interface ConstantVisitor
public void visitIntegerConstant(Clazz clazz, IntegerConstant integerConstant)
visitIntegerConstant
in interface ConstantVisitor
public static boolean isSupportedMetadataVersion(KotlinMetadataVersion mv)
public static boolean isValidKotlinMetadataAnnotationField(java.lang.String name)
public static KotlinMetadataType metadataTypeOf(java.lang.String name)