ByteBuddy.Definable<T>, ByteBuddy.MatchedMethodInterception, ByteBuddy.MethodAnnotationTarget, ByteBuddy.MethodInterceptable, ByteBuddy.OptionalMethodInterception
Modifier and Type | Field and Description |
---|---|
protected MethodAttributeAppender.Factory |
attributeAppenderFactory
The method attribute appender factory that was defined for the current method selection.
|
protected Instrumentation |
instrumentation
The instrumentation that was defined for the current method selection.
|
protected MethodMatcher |
methodMatcher
The method matcher representing the current method selection.
|
bridgeMethodResolverFactory, classFileVersion, classVisitorWrapperChain, defaultFieldAttributeAppenderFactory, defaultMethodAttributeAppenderFactory, ignoredMethods, interfaceTypes, methodRegistry, modifiers, namingStrategy, typeAttributeAppender
Modifier | Constructor and Description |
---|---|
protected |
MethodAnnotationTarget(ClassFileVersion classFileVersion,
NamingStrategy namingStrategy,
List<TypeDescription> interfaceTypes,
MethodMatcher ignoredMethods,
BridgeMethodResolver.Factory bridgeMethodResolverFactory,
ClassVisitorWrapper.Chain classVisitorWrapperChain,
MethodRegistry methodRegistry,
ByteBuddy.Definable<Integer> modifiers,
ByteBuddy.Definable<TypeAttributeAppender> typeAttributeAppender,
FieldAttributeAppender.Factory defaultFieldAttributeAppenderFactory,
MethodAttributeAppender.Factory defaultMethodAttributeAppenderFactory,
MethodMatcher methodMatcher,
Instrumentation instrumentation,
MethodAttributeAppender.Factory attributeAppenderFactory)
Creates a new method annotation target.
|
Modifier and Type | Method and Description |
---|---|
ByteBuddy.MethodAnnotationTarget |
annotateMethod(Annotation... annotation)
Defines an method annotation for the currently selected methods.
|
ByteBuddy.MethodAnnotationTarget |
annotateParameter(int parameterIndex,
Annotation... annotation)
Defines an method annotation for a parameter of the currently selected methods.
|
ByteBuddy.MethodAnnotationTarget |
attribute(MethodAttributeAppender.Factory attributeAppenderFactory)
Defines a given attribute appender factory to be applied for the currently selected methods.
|
boolean |
equals(Object other) |
ClassFileVersion |
getClassFileVersion()
Returns the class format version that is defined for the current configuration.
|
ClassVisitorWrapper.Chain |
getClassVisitorWrapperChain()
Returns the class visitor wrapper chain for the current configuration.
|
FieldAttributeAppender.Factory |
getDefaultFieldAttributeAppenderFactory()
Returns the default field attribute appender factory which is applied to any field that is defined
for instrumentations that are applied by this configuration.
|
MethodAttributeAppender.Factory |
getDefaultMethodAttributeAppenderFactory()
Returns the default method attribute appender factory which is applied to any method that is defined
or intercepted for instrumentations that are applied by this configuration.
|
MethodMatcher |
getIgnoredMethods()
Returns the matcher for the ignored methods for the current configuration.
|
List<TypeDescription> |
getInterfaceTypes()
Returns the naming strategy for the current configuration.
|
NamingStrategy |
getNamingStrategy()
Returns the naming strategy for the current configuration.
|
int |
hashCode() |
ByteBuddy.MatchedMethodInterception |
invokable(MethodMatcher methodMatcher)
Intercepts a given selection of byte code methods that can be a method or a constructor.
|
protected ByteBuddy |
materialize()
Materializes this configuration as new
ByteBuddy instance. |
<T> DynamicType.Builder<T> |
subclass(Class<T> superType)
Creates a dynamic type builder that creates a subclass of a given loaded type where the subclass
is created by the
ConstructorStrategy.Default.IMITATE_SUPER_TYPE
strategy. |
<T> DynamicType.Builder<T> |
subclass(Class<T> superType,
ConstructorStrategy constructorStrategy)
Creates a dynamic type builder that creates a subclass of a given loaded type.
|
<T> DynamicType.Builder<T> |
subclass(TypeDescription superType)
Creates a dynamic type builder that creates a subclass of a given type description where the subclass
is created by the
ConstructorStrategy.Default.IMITATE_SUPER_TYPE
strategy. |
<T> DynamicType.Builder<T> |
subclass(TypeDescription superType,
ConstructorStrategy constructorStrategy)
Creates a dynamic type builder that creates a subclass of a given type description.
|
String |
toString() |
ByteBuddy |
withAttribute(TypeAttributeAppender typeAttributeAppender)
Defines a new type attribute appender for this configuration that replaces the currently defined type
attribute appender.
|
ByteBuddy |
withClassFormatVersion(ClassFileVersion classFileVersion)
Defines a new class format version for this configuration.
|
ByteBuddy |
withClassVisitor(ClassVisitorWrapper classVisitorWrapper)
Defines a new class visitor to be appended to the current collection of
ClassVisitor s
that are to be applied onto any creation process of a dynamic type. |
ByteBuddy |
withDefaultFieldAttributeAppender(FieldAttributeAppender.Factory attributeAppenderFactory)
Defines a new default field attribute appender factory that is applied onto any field.
|
ByteBuddy |
withDefaultMethodAttributeAppender(MethodAttributeAppender.Factory attributeAppenderFactory)
Defines a new default method attribute appender factory that is applied onto any method.
|
ByteBuddy |
withIgnoredMethods(MethodMatcher ignoredMethods)
Defines a new method matcher for methods that are ignored by any dynamic type that is created by this
configuration which will replace the current configuration.
|
ByteBuddy.OptionalMethodInterception |
withImplementing(Class<?> type)
Defines all dynamic types that are created by this configuration to implement the given interface.
|
ByteBuddy.OptionalMethodInterception |
withImplementing(TypeDescription type)
Defines all dynamic types that are created by this configuration to implement the given interface.
|
ByteBuddy |
withModifiers(ModifierContributor.ForType... modifierContributor)
Defines a new modifier contributors for this configuration that replaces the currently defined modifier
contributes which might currently be implicit.
|
ByteBuddy |
withNamingStrategy(NamingStrategy namingStrategy)
Defines a new naming strategy for this configuration.
|
ByteBuddy |
withTypeAnnotation(Annotation... annotation)
Defines a new type annotation for this configuration that replaces the currently defined type
attribute appender.
|
constructor, getBridgeMethodResolverFactory, getMethodRegistry, getModifiers, getTypeAttributeAppender, method
protected final MethodMatcher methodMatcher
protected final Instrumentation instrumentation
protected final MethodAttributeAppender.Factory attributeAppenderFactory
protected MethodAnnotationTarget(ClassFileVersion classFileVersion, NamingStrategy namingStrategy, List<TypeDescription> interfaceTypes, MethodMatcher ignoredMethods, BridgeMethodResolver.Factory bridgeMethodResolverFactory, ClassVisitorWrapper.Chain classVisitorWrapperChain, MethodRegistry methodRegistry, ByteBuddy.Definable<Integer> modifiers, ByteBuddy.Definable<TypeAttributeAppender> typeAttributeAppender, FieldAttributeAppender.Factory defaultFieldAttributeAppenderFactory, MethodAttributeAppender.Factory defaultMethodAttributeAppenderFactory, MethodMatcher methodMatcher, Instrumentation instrumentation, MethodAttributeAppender.Factory attributeAppenderFactory)
classFileVersion
- The currently defined class format version.namingStrategy
- The currently defined naming strategy.interfaceTypes
- The currently defined collection of interfaces to be implemented
by any dynamically created type.ignoredMethods
- The methods to always be ignored.bridgeMethodResolverFactory
- The bridge method resolver factory to be applied to any instrumentation
process.classVisitorWrapperChain
- The class visitor wrapper chain to be applied to any instrumentation
process.methodRegistry
- The currently valid method registry.modifiers
- The modifiers to define for any instrumentation process.typeAttributeAppender
- The type attribute appender to apply to any instrumentation process.defaultFieldAttributeAppenderFactory
- The field attribute appender to apply as a default for any field
definition.defaultMethodAttributeAppenderFactory
- The method attribute appender to apply as a default for any
method definition or instrumentation.methodMatcher
- The method matcher representing the current method selection.instrumentation
- The instrumentation that was defined for the current method
selection.attributeAppenderFactory
- The method attribute appender factory that was defined for the
current method selection.public ByteBuddy.MethodAnnotationTarget attribute(MethodAttributeAppender.Factory attributeAppenderFactory)
attributeAppenderFactory
- The method attribute appender factory to apply to the currently
selected methods.public ByteBuddy.MethodAnnotationTarget annotateMethod(Annotation... annotation)
annotation
- The annotations to defined for the currently selected methods.public ByteBuddy.MethodAnnotationTarget annotateParameter(int parameterIndex, Annotation... annotation)
parameterIndex
- The index of the parameter for which the annotations should be applied
with the first parameter index by 0
.annotation
- The annotations to defined for the currently selected methods' parameters
ath the given index.public ClassFileVersion getClassFileVersion()
ByteBuddy
getClassFileVersion
in class ByteBuddy
public NamingStrategy getNamingStrategy()
ByteBuddy
getNamingStrategy
in class ByteBuddy
public List<TypeDescription> getInterfaceTypes()
ByteBuddy
getInterfaceTypes
in class ByteBuddy
public MethodMatcher getIgnoredMethods()
ByteBuddy
getIgnoredMethods
in class ByteBuddy
public ClassVisitorWrapper.Chain getClassVisitorWrapperChain()
ByteBuddy
getClassVisitorWrapperChain
in class ByteBuddy
public FieldAttributeAppender.Factory getDefaultFieldAttributeAppenderFactory()
ByteBuddy
getDefaultFieldAttributeAppenderFactory
in class ByteBuddy
public MethodAttributeAppender.Factory getDefaultMethodAttributeAppenderFactory()
ByteBuddy
getDefaultMethodAttributeAppenderFactory
in class ByteBuddy
public <T> DynamicType.Builder<T> subclass(Class<T> superType)
ByteBuddy
ConstructorStrategy.Default.IMITATE_SUPER_TYPE
strategy.subclass
in class ByteBuddy
T
- The most specific known type that the created dynamic type represents.superType
- The type or interface to be extended or implemented by the dynamic type.public <T> DynamicType.Builder<T> subclass(Class<T> superType, ConstructorStrategy constructorStrategy)
ByteBuddy
subclass
in class ByteBuddy
T
- The most specific known type that the created dynamic type represents.superType
- The type or interface to be extended or implemented by the dynamic type.constructorStrategy
- The constructor strategy to apply.public <T> DynamicType.Builder<T> subclass(TypeDescription superType)
ByteBuddy
ConstructorStrategy.Default.IMITATE_SUPER_TYPE
strategy.subclass
in class ByteBuddy
T
- The most specific known type that the created dynamic type represents.superType
- The type or interface to be extended or implemented by the dynamic type.public <T> DynamicType.Builder<T> subclass(TypeDescription superType, ConstructorStrategy constructorStrategy)
ByteBuddy
subclass
in class ByteBuddy
T
- The most specific known type that the created dynamic type represents.superType
- The type or interface to be extended or implemented by the dynamic type.constructorStrategy
- The constructor strategy to apply.public ByteBuddy withModifiers(ModifierContributor.ForType... modifierContributor)
ByteBuddy
withModifiers
in class ByteBuddy
modifierContributor
- The modifier contributors to define explicitly for this configuration.public ByteBuddy withAttribute(TypeAttributeAppender typeAttributeAppender)
ByteBuddy
withAttribute
in class ByteBuddy
typeAttributeAppender
- The type attribute appender to define for this configuration.public ByteBuddy withTypeAnnotation(Annotation... annotation)
ByteBuddy
withTypeAnnotation
in class ByteBuddy
annotation
- The type annotations to define for this configuration.public ByteBuddy withClassFormatVersion(ClassFileVersion classFileVersion)
ByteBuddy
withClassFormatVersion
in class ByteBuddy
classFileVersion
- The class format version to define for this configuration.public ByteBuddy withNamingStrategy(NamingStrategy namingStrategy)
ByteBuddy
withNamingStrategy
in class ByteBuddy
namingStrategy
- The class format version to define for this configuration.public ByteBuddy.OptionalMethodInterception withImplementing(Class<?> type)
ByteBuddy
withImplementing
in class ByteBuddy
type
- The interface type to implement.public ByteBuddy.OptionalMethodInterception withImplementing(TypeDescription type)
ByteBuddy
withImplementing
in class ByteBuddy
type
- The interface type to implement.public ByteBuddy withIgnoredMethods(MethodMatcher ignoredMethods)
ByteBuddy
withIgnoredMethods
in class ByteBuddy
ignoredMethods
- The methods to always be ignored for any instrumentation.public ByteBuddy withClassVisitor(ClassVisitorWrapper classVisitorWrapper)
ByteBuddy
ClassVisitor
s
that are to be applied onto any creation process of a dynamic type.withClassVisitor
in class ByteBuddy
classVisitorWrapper
- The class visitor wrapper to ba appended to the current chain of class visitor wrappers.public ByteBuddy withDefaultFieldAttributeAppender(FieldAttributeAppender.Factory attributeAppenderFactory)
ByteBuddy
withDefaultFieldAttributeAppender
in class ByteBuddy
attributeAppenderFactory
- The attribute appender factory that is applied as a default on any
field that is created by a dynamic type that is created with this
configuration.public ByteBuddy withDefaultMethodAttributeAppender(MethodAttributeAppender.Factory attributeAppenderFactory)
ByteBuddy
withDefaultMethodAttributeAppender
in class ByteBuddy
attributeAppenderFactory
- The attribute appender factory that is applied as a default on any
method that is created or intercepted by a dynamic type that is created
with this configuration.public ByteBuddy.MatchedMethodInterception invokable(MethodMatcher methodMatcher)
ByteBuddy
protected ByteBuddy materialize()
ByteBuddy
instance.ByteBuddy
instance representing the current configuration.Copyright © 2014. All rights reserved.