Package net.bytebuddy.dynamic.scaffold
Class TypeWriter.Default.ForInlining.WithDecorationOnly.DecorationClassVisitor
java.lang.Object
org.objectweb.asm.ClassVisitor
net.bytebuddy.utility.visitor.MetadataAwareClassVisitor
net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ForInlining.WithDecorationOnly.DecorationClassVisitor
- All Implemented Interfaces:
TypeInitializer.Drain
- Enclosing class:
TypeWriter.Default.ForInlining.WithDecorationOnly<V>
protected class TypeWriter.Default.ForInlining.WithDecorationOnly.DecorationClassVisitor
extends MetadataAwareClassVisitor
implements TypeInitializer.Drain
A class visitor that decorates an existing type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeInitializer.Drain
TypeInitializer.Drain.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeWriter.Default.ForInlining.ContextRegistry
A context registry to register the lazily created implementation context to.The implementation context to use ornull
if the context is not yet initialized.private final int
The reader flags being used.private final int
The writer flags being used.Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DecorationClassVisitor
(org.objectweb.asm.ClassVisitor classVisitor, TypeWriter.Default.ForInlining.ContextRegistry contextRegistry, int writerFlags, int readerFlags) Creates a class visitor which is capable of decorating an existent class on the fly. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext) Applies the drain.protected void
Invoked if the attribute visitation is about to complete.protected org.objectweb.asm.AnnotationVisitor
onVisitAnnotation
(String descriptor, boolean visible) An order-sensitive invocation ofClassVisitor.visitAnnotation(String, boolean)
.protected void
An order-sensitive invocation ofClassVisitor.visitEnd()
.protected org.objectweb.asm.AnnotationVisitor
onVisitTypeAnnotation
(int typeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) An order-sensitive invocation ofClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean)
.void
visit
(int classFileVersionNumber, int modifiers, String internalName, String genericSignature, String superClassInternalName, String[] interfaceTypeInternalName) Methods inherited from class net.bytebuddy.utility.visitor.MetadataAwareClassVisitor
onNestHost, onOuterType, onVisitAttribute, onVisitField, onVisitInnerClass, onVisitMethod, onVisitNestHost, onVisitNestMember, onVisitOuterClass, onVisitPermittedSubclass, onVisitRecordComponent, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitTypeAnnotation
Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visitModule, visitSource
-
Field Details
-
contextRegistry
A context registry to register the lazily created implementation context to. -
writerFlags
private final int writerFlagsThe writer flags being used. -
readerFlags
private final int readerFlagsThe reader flags being used. -
implementationContext
The implementation context to use ornull
if the context is not yet initialized.
-
-
Constructor Details
-
DecorationClassVisitor
protected DecorationClassVisitor(org.objectweb.asm.ClassVisitor classVisitor, TypeWriter.Default.ForInlining.ContextRegistry contextRegistry, int writerFlags, int readerFlags) Creates a class visitor which is capable of decorating an existent class on the fly.- Parameters:
classVisitor
- The underlying class visitor to which writes are delegated.contextRegistry
- A context registry to register the lazily created implementation context to.writerFlags
- The writer flags being used.readerFlags
- The reader flags being used.
-
-
Method Details
-
visit
public void visit(int classFileVersionNumber, int modifiers, String internalName, String genericSignature, String superClassInternalName, String[] interfaceTypeInternalName) - Overrides:
visit
in classorg.objectweb.asm.ClassVisitor
-
onVisitTypeAnnotation
@MaybeNull protected org.objectweb.asm.AnnotationVisitor onVisitTypeAnnotation(int typeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) Description copied from class:MetadataAwareClassVisitor
An order-sensitive invocation ofClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean)
.- Overrides:
onVisitTypeAnnotation
in classMetadataAwareClassVisitor
- Parameters:
typeReference
- The type reference of the type annotation.typePath
- The type path of the type annotation.descriptor
- The descriptor of the annotation type.visible
-true
if the annotation is visible at runtime.- Returns:
- An annotation visitor or
null
if the annotation should be ignored.
-
onVisitAnnotation
@MaybeNull protected org.objectweb.asm.AnnotationVisitor onVisitAnnotation(String descriptor, boolean visible) Description copied from class:MetadataAwareClassVisitor
An order-sensitive invocation ofClassVisitor.visitAnnotation(String, boolean)
.- Overrides:
onVisitAnnotation
in classMetadataAwareClassVisitor
- Parameters:
descriptor
- The annotation type's descriptor.visible
-true
if the annotation is visible at runtime.- Returns:
- An annotation visitor or
null
if the annotation should be ignored.
-
onAfterAttributes
protected void onAfterAttributes()Description copied from class:MetadataAwareClassVisitor
Invoked if the attribute visitation is about to complete.- Overrides:
onAfterAttributes
in classMetadataAwareClassVisitor
-
onVisitEnd
protected void onVisitEnd()Description copied from class:MetadataAwareClassVisitor
An order-sensitive invocation ofClassVisitor.visitEnd()
.- Overrides:
onVisitEnd
in classMetadataAwareClassVisitor
-
apply
public void apply(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext) Applies the drain.- Specified by:
apply
in interfaceTypeInitializer.Drain
- Parameters:
classVisitor
- The class visitor to apply the initializer to.typeInitializer
- The type initializer to write.implementationContext
- The corresponding implementation context.
-