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, BYTE_BUDDY_DEFAULT_PREFIX, BYTE_BUDDY_DEFAULT_SUFFIX, classFileVersion, classVisitorWrapper, defaultFieldAttributeAppenderFactory, defaultMethodAttributeAppenderFactory, ignoredMethods, implementationContextFactory, interfaceTypes, methodGraphCompiler, methodRegistry, modifiers, namingStrategy, typeAttributeAppender
Modifier | Constructor and Description |
---|---|
protected |
OptionalMethodInterception(ClassFileVersion classFileVersion,
NamingStrategy.Unbound namingStrategy,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
List<TypeDescription> interfaceTypes,
ElementMatcher<? super MethodDescription> ignoredMethods,
ClassVisitorWrapper classVisitorWrapper,
MethodRegistry methodRegistry,
ByteBuddy.Definable<Integer> modifiers,
TypeAttributeAppender typeAttributeAppender,
MethodGraph.Compiler methodGraphCompiler,
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 currently selected methods with the provided implementation.
|
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()
Implements the currently selected methods as
abstract methods. |
constructor, invokable, invokable, makeAnnotation, makeEnumeration, makeEnumeration, makeInterface, makeInterface, makeInterface, makeInterface, makeInterface, makeInterface, makePackage, method, rebase, rebase, rebase, rebase, rebase, rebase, rebase, redefine, redefine, redefine, subclass, subclass, subclass, subclass, withAttribute, withClassFileVersion, withClassVisitor, withContext, withDefaultFieldAttributeAppender, withDefaultMethodAttributeAppender, withIgnoredMethods, withImplementing, withImplementing, withImplementing, withImplementing, withMethodGraphCompiler, withModifiers, withNamingStrategy, withNamingStrategy, withNamingStrategy, withTypeAnnotation, withTypeAnnotation, withTypeAnnotation, withTypeAnnotation
protected final LatentMethodMatcher methodMatcher
protected OptionalMethodInterception(ClassFileVersion classFileVersion, NamingStrategy.Unbound namingStrategy, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, Implementation.Context.Factory implementationContextFactory, List<TypeDescription> interfaceTypes, ElementMatcher<? super MethodDescription> ignoredMethods, ClassVisitorWrapper classVisitorWrapper, MethodRegistry methodRegistry, ByteBuddy.Definable<Integer> modifiers, TypeAttributeAppender typeAttributeAppender, MethodGraph.Compiler methodGraphCompiler, 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.implementationContextFactory
- The currently defined implementation context factory.interfaceTypes
- The currently defined collection of interfaces to be implemented
by any dynamically created type.ignoredMethods
- The methods to always be ignored.
process.classVisitorWrapper
- The class visitor wrapper 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.methodGraphCompiler
- The method graph compiler to use.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 currently selected method.public ByteBuddy.MethodAnnotationTarget withoutCode()
ByteBuddy.MethodInterceptable
abstract
methods.withoutCode
in interface ByteBuddy.MethodInterceptable
abstract
methods.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 actual form 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.