public static class ByteBuddy.OptionalMethodInterception extends ByteBuddy implements ByteBuddy.MethodInterceptable
ByteBuddy.Definable<T>, ByteBuddy.EnumerationImplementation, ByteBuddy.MatchedMethodInterception, ByteBuddy.MethodAnnotationTarget, ByteBuddy.MethodInterceptable, ByteBuddy.OptionalMethodInterception, ByteBuddy.Proxy
Modifier and Type | Field and Description |
---|---|
protected LatentMethodMatcher |
methodMatcher
The method matcher that defines the selected that is represented by this instance.
|
auxiliaryTypeNamingStrategy, bridgeMethodResolverFactory, BYTE_BUDDY_DEFAULT_PREFIX, BYTE_BUDDY_DEFAULT_SUFFIX, classFileVersion, classVisitorWrapperChain, defaultFieldAttributeAppenderFactory, defaultMethodAttributeAppenderFactory, ignoredMethods, interfaceTypes, methodLookupEngineFactory, methodRegistry, modifiers, namingStrategy, typeAttributeAppender
Modifier | Constructor and Description |
---|---|
protected |
OptionalMethodInterception(ClassFileVersion classFileVersion,
NamingStrategy.Unbound namingStrategy,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
List<TypeDescription> interfaceTypes,
ElementMatcher<? super MethodDescription> ignoredMethods,
BridgeMethodResolver.Factory bridgeMethodResolverFactory,
ClassVisitorWrapper.Chain classVisitorWrapperChain,
MethodRegistry methodRegistry,
ByteBuddy.Definable<Integer> modifiers,
TypeAttributeAppender typeAttributeAppender,
MethodLookupEngine.Factory methodLookupEngineFactory,
FieldAttributeAppender.Factory defaultFieldAttributeAppenderFactory,
MethodAttributeAppender.Factory defaultMethodAttributeAppenderFactory,
LatentMethodMatcher methodMatcher)
Creates a new optional method interception.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
ByteBuddy.MethodAnnotationTarget |
intercept(Implementation implementation)
Intercepts the given method with the given implementations.
|
String |
toString() |
ByteBuddy.MethodAnnotationTarget |
withDefaultValue(Object value)
Defines a default annotation value to set for any matched method.
|
ByteBuddy.MethodAnnotationTarget |
withDefaultValue(Object value,
Class<?> type)
Defines a default annotation value to set for any matched method.
|
ByteBuddy.MethodAnnotationTarget |
withoutCode()
Defines the currently selected methods as
abstract . |
constructor, getAuxiliaryTypeNamingStrategy, getBridgeMethodResolverFactory, getClassFileVersion, getClassVisitorWrapperChain, getDefaultFieldAttributeAppenderFactory, getDefaultMethodAttributeAppenderFactory, getIgnoredMethods, getInterfaceTypes, getMethodLookupEngineFactory, getMethodRegistry, getModifiers, getNamingStrategy, getTypeAttributeAppender, invokable, invokeable, makeAnnotation, makeEnumeration, makeEnumeration, makeInterface, makeInterface, makeInterface, makeInterface, makeInterface, makeInterface, method, rebase, rebase, rebase, rebase, rebase, redefine, redefine, redefine, subclass, subclass, subclass, subclass, withAttribute, withBridgeMethodResolver, withClassFileVersion, withClassVisitor, withDefaultFieldAttributeAppender, withDefaultMethodAttributeAppender, withIgnoredMethods, withImplementing, withImplementing, withImplementing, withImplementing, withMethodLookupEngine, withModifiers, withNamingStrategy, withNamingStrategy, withNamingStrategy, withTypeAnnotation, withTypeAnnotation, withTypeAnnotation, withTypeAnnotation
protected final LatentMethodMatcher methodMatcher
protected OptionalMethodInterception(ClassFileVersion classFileVersion, NamingStrategy.Unbound namingStrategy, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, List<TypeDescription> interfaceTypes, ElementMatcher<? super MethodDescription> ignoredMethods, BridgeMethodResolver.Factory bridgeMethodResolverFactory, ClassVisitorWrapper.Chain classVisitorWrapperChain, MethodRegistry methodRegistry, ByteBuddy.Definable<Integer> modifiers, TypeAttributeAppender typeAttributeAppender, MethodLookupEngine.Factory methodLookupEngineFactory, FieldAttributeAppender.Factory defaultFieldAttributeAppenderFactory, MethodAttributeAppender.Factory defaultMethodAttributeAppenderFactory, LatentMethodMatcher methodMatcher)
classFileVersion
- The currently defined class file version.namingStrategy
- The currently defined naming strategy.auxiliaryTypeNamingStrategy
- The currently defined naming strategy for auxiliary types.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 implementation
process.classVisitorWrapperChain
- The class visitor wrapper chain to be applied to any implementation
process.methodRegistry
- The currently valid method registry.modifiers
- The modifiers to define for any implementation process.typeAttributeAppender
- The type attribute appender to apply to any implementation process.methodLookupEngineFactory
- The method lookup engine factory to apply to this configuration.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 implementation.methodMatcher
- The method matcher representing the current method selection.public ByteBuddy.MethodAnnotationTarget intercept(Implementation implementation)
ByteBuddy.MethodInterceptable
intercept
in interface ByteBuddy.MethodInterceptable
implementation
- The implementation to apply to the selected methods.public ByteBuddy.MethodAnnotationTarget withoutCode()
ByteBuddy.MethodInterceptable
abstract
.withoutCode
in interface ByteBuddy.MethodInterceptable
abstract
.public ByteBuddy.MethodAnnotationTarget withDefaultValue(Object value, Class<?> type)
ByteBuddy.MethodInterceptable
withDefaultValue
in interface ByteBuddy.MethodInterceptable
value
- The value that the annotation property should set as a default.type
- The type of the annotation property.public ByteBuddy.MethodAnnotationTarget withDefaultValue(Object value)
ByteBuddy.MethodInterceptable
enum
values should be handed as EnumerationDescription
instances, annotations as AnnotationDescription
instances and
Class
values as TypeDescription
instances. Other values are handed in their raw format or as their wrapper types.withDefaultValue
in interface ByteBuddy.MethodInterceptable
value
- A non-loaded value that the annotation property should set as a default.Copyright © 2014–2015. All rights reserved.