T - The type of the mapped class visitor.@HashCodeAndEqualsPlugin.Enhance public abstract class ClassVisitorFactory<T> extends Object
ClassVisitor in Byte Buddy's package namespace to a
ClassVisitor in any other namespace. Note that this API does not allow for the
passing of Attributes. which must be filtered or propagated past this translation.
If the supplied visitors do not declare a method that Byte Buddy's version of ASM is aware
of, an UnsupportedOperationException is thrown.| Modifier and Type | Class and Description |
|---|---|
protected static class |
ClassVisitorFactory.AttributeTranslator
A method to wrap an
Attribute. |
protected static class |
ClassVisitorFactory.ConstantArrayTranslator
A method to translate an array of constants from one namespace to another.
|
protected static class |
ClassVisitorFactory.ConstantDynamicTranslator
A method to translate a
ConstantDynamic from one namespace to another. |
protected static class |
ClassVisitorFactory.ConstantTranslator
A method to translate a constant value from one namespace to another.
|
protected static class |
ClassVisitorFactory.CreateClassVisitorFactory<S>
A factory for creating a wrapper for a
ClassVisitor. |
protected static class |
ClassVisitorFactory.FrameTranslator
A method to translate a stack map frame array from one namespace to another.
|
protected static class |
ClassVisitorFactory.HandleTranslator
A method to translate a
Handle from one namespace to another. |
protected static class |
ClassVisitorFactory.LabelArrayTranslator
A method to translate an array of
Labels from one namespace to another. |
protected static class |
ClassVisitorFactory.LabelTranslator
A method to translate a
Label from one namespace to another. |
protected static class |
ClassVisitorFactory.NullCheckedConstruction
An appender that performs a
null-checked construction. |
protected static class |
ClassVisitorFactory.TypePathTranslator
A method to translate a
TypePath type from one namespace to another. |
| Modifier | Constructor and Description |
|---|---|
protected |
ClassVisitorFactory(Class<?> type)
Creates a new factory.
|
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
getType()
Returns the
ClassVisitor type that this factory represents. |
static <S> ClassVisitorFactory<S> |
of(Class<S> classVisitor)
Returns a class visitor factory for the supplied
ClassVisitor type. |
static <S> ClassVisitorFactory<S> |
of(Class<S> classVisitor,
ByteBuddy byteBuddy)
Returns a class visitor factory for the supplied
ClassVisitor type. |
abstract ClassVisitor |
unwrap(T classVisitor)
Unwraps an instance of the supplied class visitor as a
ClassVisitor. |
abstract T |
wrap(ClassVisitor classVisitor)
Wraps a
ClassVisitor within an instance of the supplied class visitor type. |
protected ClassVisitorFactory(Class<?> type)
type - The type of the represented class visitor wrapper.public Class<?> getType()
ClassVisitor type that this factory represents.ClassVisitor type that this factory represents.public static <S> ClassVisitorFactory<S> of(Class<S> classVisitor)
ClassVisitor type.S - The type of the class visitor to map to.classVisitor - The type of the translated class visitor.ClassVisitors in Byte Buddy's and the supplied package namespace.public static <S> ClassVisitorFactory<S> of(Class<S> classVisitor, ByteBuddy byteBuddy)
ClassVisitor type.S - The type of the class visitor to map to.classVisitor - The type of the translated ClassVisitor.byteBuddy - The Byte Buddy instance to use.ClassVisitors in Byte Buddy's and the supplied package namespace.public abstract T wrap(ClassVisitor classVisitor)
ClassVisitor within an instance of the supplied class visitor type.classVisitor - The class visitor to wrap.public abstract ClassVisitor unwrap(T classVisitor)
ClassVisitor.classVisitor - The class visitor to unwrap.Copyright © 2014–2023. All rights reserved.