Class ClassVisitorFactory<T>
java.lang.Object
net.bytebuddy.asm.ClassVisitorFactory<T>
- Type Parameters:
T- The type of the mapped class visitor.
A factory for wrapping a
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA method to wrap anAttribute.protected static classA method to translate an array of constants from one namespace to another.protected static classA method to translate aConstantDynamicfrom one namespace to another.protected static classA method to translate a constant value from one namespace to another.protected static classA factory for creating a wrapper for aClassVisitor.protected static classA method to translate a stack map frame array from one namespace to another.protected static classA method to translate aHandlefrom one namespace to another.protected static classA method to translate an array ofLabels from one namespace to another.protected static classA method to translate aLabelfrom one namespace to another.protected static classAn appender that performs anull-checked construction.protected static classA method to translate aTypePathtype from one namespace to another. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClassVisitorFactory(Class<?> type) Creates a new factory. -
Method Summary
Modifier and TypeMethodDescriptionClass<?> getType()Returns theClassVisitortype that this factory represents.static <S> ClassVisitorFactory<S> Returns a class visitor factory for the suppliedClassVisitortype.static <S> ClassVisitorFactory<S> Returns a class visitor factory for the suppliedClassVisitortype.abstract org.objectweb.asm.ClassVisitorUnwraps an instance of the supplied class visitor as aClassVisitor.abstract Twrap(org.objectweb.asm.ClassVisitor classVisitor) Wraps aClassVisitorwithin an instance of the supplied class visitor type.
-
Constructor Details
-
ClassVisitorFactory
Creates a new factory.- Parameters:
type- The type of the represented class visitor wrapper.
-
-
Method Details
-
getType
Returns theClassVisitortype that this factory represents.- Returns:
- The
ClassVisitortype that this factory represents.
-
of
Returns a class visitor factory for the suppliedClassVisitortype.- Type Parameters:
S- The type of the class visitor to map to.- Parameters:
classVisitor- The type of the translated class visitor.- Returns:
- A factory for wrapping
ClassVisitors in Byte Buddy's and the supplied package namespace.
-
of
Returns a class visitor factory for the suppliedClassVisitortype.- Type Parameters:
S- The type of the class visitor to map to.- Parameters:
classVisitor- The type of the translatedClassVisitor.byteBuddy- The Byte Buddy instance to use.- Returns:
- A factory for wrapping
ClassVisitors in Byte Buddy's and the supplied package namespace.
-
wrap
Wraps aClassVisitorwithin an instance of the supplied class visitor type.- Parameters:
classVisitor- The class visitor to wrap.- Returns:
- A class visitor that wraps the supplied class visitor.
-
unwrap
Unwraps an instance of the supplied class visitor as aClassVisitor.- Parameters:
classVisitor- The class visitor to unwrap.- Returns:
- A class visitor that unwraps the supplied class visitor.
-