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
Fields Modifier and Type Field Description private TypeWriter.Default.ForInlining.ContextRegistrycontextRegistryA context registry to register the lazily created implementation context to.private Implementation.Context.ExtractableViewimplementationContextThe implementation context to use ornullif the context is not yet initialized.private intreaderFlagsThe reader flags being used.private intwriterFlagsThe writer flags being used.
-
Constructor Summary
Constructors Modifier Constructor Description protectedDecorationClassVisitor(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext)Applies the drain.protected voidonAfterAttributes()Invoked if the attribute visitation is about to complete.protected voidonNestHost()Invoked if the nest host was not visited.protected voidonOuterType()Invoked if the outer class was not visited.protected org.objectweb.asm.AnnotationVisitoronVisitAnnotation(java.lang.String descriptor, boolean visible)An order-sensitive invocation ofClassVisitor.visitAnnotation(String, boolean).protected voidonVisitEnd()An order-sensitive invocation ofClassVisitor.visitEnd().protected org.objectweb.asm.AnnotationVisitoronVisitTypeAnnotation(int typeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)An order-sensitive invocation ofClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean).voidvisit(int classFileVersionNumber, int modifiers, java.lang.String internalName, java.lang.String genericSignature, java.lang.String superClassInternalName, java.lang.String[] interfaceTypeInternalName)-
Methods inherited from class net.bytebuddy.utility.visitor.MetadataAwareClassVisitor
onVisitAttribute, onVisitField, onVisitInnerClass, onVisitMethod, onVisitNestHost, onVisitNestMember, onVisitOuterClass, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitNestHost, visitNestMember, visitOuterClass, visitTypeAnnotation
-
-
-
-
Field Detail
-
contextRegistry
private final TypeWriter.Default.ForInlining.ContextRegistry contextRegistry
A context registry to register the lazily created implementation context to.
-
writerFlags
private final int writerFlags
The writer flags being used.
-
readerFlags
private final int readerFlags
The reader flags being used.
-
implementationContext
private Implementation.Context.ExtractableView implementationContext
The implementation context to use ornullif the context is not yet initialized.
-
-
Constructor Detail
-
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 Detail
-
visit
public void visit(int classFileVersionNumber, int modifiers, java.lang.String internalName, java.lang.String genericSignature, java.lang.String superClassInternalName, java.lang.String[] interfaceTypeInternalName)- Overrides:
visitin classorg.objectweb.asm.ClassVisitor
-
onNestHost
protected void onNestHost()
Description copied from class:MetadataAwareClassVisitorInvoked if the nest host was not visited.- Specified by:
onNestHostin classMetadataAwareClassVisitor
-
onOuterType
protected void onOuterType()
Description copied from class:MetadataAwareClassVisitorInvoked if the outer class was not visited.- Specified by:
onOuterTypein classMetadataAwareClassVisitor
-
onVisitTypeAnnotation
protected org.objectweb.asm.AnnotationVisitor onVisitTypeAnnotation(int typeReference, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)Description copied from class:MetadataAwareClassVisitorAn order-sensitive invocation ofClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean).- Overrides:
onVisitTypeAnnotationin 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-trueif the annotation is visible at runtime.- Returns:
- An annotation visitor or
nullif the annotation should be ignored.
-
onVisitAnnotation
protected org.objectweb.asm.AnnotationVisitor onVisitAnnotation(java.lang.String descriptor, boolean visible)Description copied from class:MetadataAwareClassVisitorAn order-sensitive invocation ofClassVisitor.visitAnnotation(String, boolean).- Overrides:
onVisitAnnotationin classMetadataAwareClassVisitor- Parameters:
descriptor- The annotation type's descriptor.visible-trueif the annotation is visible at runtime.- Returns:
- An annotation visitor or
nullif the annotation should be ignored.
-
onAfterAttributes
protected void onAfterAttributes()
Description copied from class:MetadataAwareClassVisitorInvoked if the attribute visitation is about to complete.- Specified by:
onAfterAttributesin classMetadataAwareClassVisitor
-
onVisitEnd
protected void onVisitEnd()
Description copied from class:MetadataAwareClassVisitorAn order-sensitive invocation ofClassVisitor.visitEnd().- Overrides:
onVisitEndin classMetadataAwareClassVisitor
-
apply
public void apply(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext)Applies the drain.- Specified by:
applyin interfaceTypeInitializer.Drain- Parameters:
classVisitor- The class visitor to apply the initializer to.typeInitializer- The type initializer to write.implementationContext- The corresponding implementation context.
-
-