protected abstract static class ByteBuddy.Proxy extends ByteBuddy
ByteBuddy
configuration.ByteBuddy.Definable<T>, ByteBuddy.EnumerationImplementation, ByteBuddy.MatchedMethodInterception, ByteBuddy.MethodAnnotationTarget, ByteBuddy.MethodInterceptable, ByteBuddy.OptionalMethodInterception, ByteBuddy.ProxyauxiliaryTypeNamingStrategy, 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 |
Proxy(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)
Defines a new proxy configuration for
ByteBuddy. |
| Modifier and Type | Method and Description |
|---|---|
ByteBuddy.MatchedMethodInterception |
constructor(ElementMatcher<? super MethodDescription> methodMatcher)
Intercepts a given constructor selection.
|
ByteBuddy.MatchedMethodInterception |
invokable(ElementMatcher<? super MethodDescription> methodMatcher)
Intercepts a given selection of byte code level methods, i.e.
|
ByteBuddy.MatchedMethodInterception |
invokable(LatentMethodMatcher methodMatcher)
Intercepts a given selection of byte code level methods, i.e.
|
DynamicType.Builder<? extends Annotation> |
makeAnnotation()
Creates a dynamic type builder for a new annotation type.
|
DynamicType.Builder<? extends Enum<?>> |
makeEnumeration(Collection<? extends String> values)
Creates a new enumeration type.
|
DynamicType.Builder<? extends Enum<?>> |
makeEnumeration(String... value)
Creates a new enumeration type.
|
DynamicType.Builder<?> |
makeInterface()
Creates a dynamic type builder for an interface that does not extend any interfaces.
|
DynamicType.Builder<?> |
makeInterface(Class<?>... type)
Creates a dynamic type builder for an interface that extends a number of given interfaces.
|
<T> DynamicType.Builder<T> |
makeInterface(Class<T> type)
Creates a dynamic type builder for an interface that extends the given interface.
|
DynamicType.Builder<?> |
makeInterface(Collection<? extends TypeDescription> typeDescriptions)
Creates a dynamic type builder for an interface that extends a number of given interfaces.
|
DynamicType.Builder<?> |
makeInterface(Iterable<? extends Class<?>> types)
Creates a dynamic type builder for an interface that extends a number of given interfaces.
|
DynamicType.Builder<?> |
makeInterface(TypeDescription... typeDescription)
Creates a dynamic type builder for an interface that extends a number of given interfaces.
|
DynamicType.Builder<?> |
makePackage(String name)
Creates a new Java package.
|
protected abstract ByteBuddy |
materialize()
Materializes the current extended configuration.
|
ByteBuddy.MatchedMethodInterception |
method(ElementMatcher<? super MethodDescription> methodMatcher)
Intercepts a given method selection.
|
<T> DynamicType.Builder<T> |
rebase(Class<T> levelType)
Creates a dynamic type by weaving any changes into an already defined level type.
|
<T> DynamicType.Builder<T> |
rebase(Class<T> levelType,
ClassFileLocator classFileLocator)
Creates a dynamic type by weaving any changes into an already defined level type.
|
<T> DynamicType.Builder<T> |
rebase(Class<T> levelType,
ClassFileLocator classFileLocator,
MethodRebaseResolver.MethodNameTransformer methodNameTransformer)
Creates a dynamic type by weaving any changes into an already defined level type.
|
DynamicType.Builder<?> |
rebase(Package aPackage,
ClassFileLocator classFileLocator)
Rebases the given the package.
|
DynamicType.Builder<?> |
rebase(PackageDescription packageDescription,
ClassFileLocator classFileLocator)
Rebases the given the package.
|
<T> DynamicType.Builder<T> |
rebase(TypeDescription levelType,
ClassFileLocator classFileLocator)
Creates a dynamic type by weaving any changes into an already defined level type.
|
<T> DynamicType.Builder<T> |
rebase(TypeDescription levelType,
ClassFileLocator classFileLocator,
MethodRebaseResolver.MethodNameTransformer methodNameTransformer)
Creates a dynamic type by weaving any changes into an already defined level type.
|
<T> DynamicType.Builder<T> |
redefine(Class<T> levelType)
Creates a dynamic type builder for redefining of the given type.
|
<T> DynamicType.Builder<T> |
redefine(Class<T> levelType,
ClassFileLocator classFileLocator)
Creates a dynamic type builder for redefining of the given type.
|
<T> DynamicType.Builder<T> |
redefine(TypeDescription levelType,
ClassFileLocator classFileLocator)
Creates a dynamic type builder for redefining of the given type.
|
<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.
|
ByteBuddy |
withAttribute(TypeAttributeAppender typeAttributeAppender)
Defines a new type attribute appender for this configuration that replaces the currently defined type
attribute appender.
|
ByteBuddy |
withClassFileVersion(ClassFileVersion classFileVersion)
Defines a new class file version for this configuration.
|
ByteBuddy |
withClassVisitor(ClassVisitorWrapper classVisitorWrapper)
Defines a new class visitor to be appended to the current collection of
ClassVisitors
that are to be applied onto any creation process of a dynamic type. |
ByteBuddy |
withContext(Implementation.Context.Factory implementationContextFactory)
Defines a factory for creating an
Implementation.Context. |
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(ElementMatcher<? super MethodDescription> 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 interfaces.
|
ByteBuddy.OptionalMethodInterception |
withImplementing(Collection<? extends TypeDescription> types)
Defines all dynamic types that are created by this configuration to implement the given interfaces.
|
ByteBuddy.OptionalMethodInterception |
withImplementing(Iterable<? extends Class<?>> types)
Defines all dynamic types that are created by this configuration to implement the given interfaces.
|
ByteBuddy.OptionalMethodInterception |
withImplementing(TypeDescription... type)
Defines all dynamic types that are created by this configuration to implement the given interfaces.
|
ByteBuddy |
withMethodGraphCompiler(MethodGraph.Compiler methodGraphCompiler)
Defines a new method graph compiler to be used for extracting a type's invokable methods.
|
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(AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy)
Defines a naming strategy for auxiliary types.
|
ByteBuddy |
withNamingStrategy(NamingStrategy.Unbound namingStrategy)
Defines a new naming strategy for this configuration.
|
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.
|
ByteBuddy |
withTypeAnnotation(AnnotationDescription... annotation)
Defines a new type annotation for this configuration that replaces the currently defined type
attribute appender.
|
ByteBuddy |
withTypeAnnotation(Collection<? extends AnnotationDescription> annotations)
Defines a new type annotation for this configuration that replaces the currently defined type
attribute appender.
|
ByteBuddy |
withTypeAnnotation(Iterable<? extends Annotation> annotations)
Defines a new type annotation for this configuration that replaces the currently defined type
attribute appender.
|
protected Proxy(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)
ByteBuddy.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.
implementation 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.public <T> DynamicType.Builder<T> subclass(Class<T> superType)
ByteBuddyConstructorStrategy.Default.IMITATE_SUPER_TYPE
strategy.subclass in class ByteBuddyT - 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)
ByteBuddysubclass in class ByteBuddyT - 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)
ByteBuddyConstructorStrategy.Default.IMITATE_SUPER_TYPE
strategy.subclass in class ByteBuddyT - 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)
ByteBuddysubclass in class ByteBuddyT - 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> redefine(Class<T> levelType)
ByteBuddy
Creates a dynamic type builder for redefining of the given type. The given class must be found on the
class path or by the class's ClassLoader. Otherwise, the class file to the redefined class
must be located explicitly by providing a locator by
ByteBuddy.redefine(Class, net.bytebuddy.dynamic.ClassFileLocator).
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is redefined several times without providing an updated
version of the class file.
public <T> DynamicType.Builder<T> redefine(Class<T> levelType, ClassFileLocator classFileLocator)
ByteBuddyCreates a dynamic type builder for redefining of the given type.
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is redefined several times without providing an updated
version of the class file.
redefine in class ByteBuddyT - The most specific known type that the created dynamic type represents.levelType - The type to redefine.classFileLocator - A locator for finding a class file that represents a type.public <T> DynamicType.Builder<T> redefine(TypeDescription levelType, ClassFileLocator classFileLocator)
ByteBuddyCreates a dynamic type builder for redefining of the given type.
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is redefined several times without providing an updated
version of the class file.
redefine in class ByteBuddyT - The most specific known type that the created dynamic type represents.levelType - The type to redefine.classFileLocator - A locator for finding a class file that represents a type.public <T> DynamicType.Builder<T> rebase(Class<T> levelType)
ByteBuddy
Creates a dynamic type by weaving any changes into an already defined level type. The rebased type is
created by adding methods to the level type where the original method implementations are copied to
renamed, private methods within the created dynamic type and therefore remain invokable as super method calls.
The result is a rebased type with subclass semantics. The given class must be found on the class path or
by the provided class's ClassLoader. Otherwise, the class file to the redefined class
must be located explicitly by providing a locator by
ByteBuddy.rebase(Class, net.bytebuddy.dynamic.ClassFileLocator).
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is rebased several times without updating the class file.
public <T> DynamicType.Builder<T> rebase(Class<T> levelType, ClassFileLocator classFileLocator)
ByteBuddyCreates a dynamic type by weaving any changes into an already defined level type. The rebased type is created by adding methods to the level type where the original method implementations are copied to renamed, private methods within the created dynamic type and therefore remain invokable as super method calls. The result is a rebased type with subclass semantics.
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is rebased several times without updating the class file.
rebase in class ByteBuddyT - The most specific known type that the created dynamic type represents.levelType - The type which is to be rebased.classFileLocator - A locator for finding a class file that represents a type.public <T> DynamicType.Builder<T> rebase(Class<T> levelType, ClassFileLocator classFileLocator, MethodRebaseResolver.MethodNameTransformer methodNameTransformer)
ByteBuddyCreates a dynamic type by weaving any changes into an already defined level type. The rebased type is created by adding methods to the level type where the original method implementations are copied to renamed, private methods within the created dynamic type and therefore remain invokable as super method calls. The result is a rebased type with subclass semantics.
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is rebased several times without updating the class file.
rebase in class ByteBuddyT - The most specific known type that the created dynamic type represents.levelType - The type which is to be rebased.classFileLocator - A locator for finding a class file that represents a type.methodNameTransformer - The method name transformer that is used for rebasing methods.public <T> DynamicType.Builder<T> rebase(TypeDescription levelType, ClassFileLocator classFileLocator)
ByteBuddyCreates a dynamic type by weaving any changes into an already defined level type. The rebased type is created by adding methods to the level type where the original method implementations are copied to renamed, private methods within the created dynamic type and therefore remain invokable as super method calls. The result is a rebased type with subclass semantics.
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is rebased several times without updating the class file.
rebase in class ByteBuddyT - The most specific known type that the created dynamic type represents.levelType - The type which is to be rebased.classFileLocator - A locator for finding a class file that represents a type.public <T> DynamicType.Builder<T> rebase(TypeDescription levelType, ClassFileLocator classFileLocator, MethodRebaseResolver.MethodNameTransformer methodNameTransformer)
ByteBuddyCreates a dynamic type by weaving any changes into an already defined level type. The rebased type is created by adding methods to the level type where the original method implementations are copied to renamed, private methods within the created dynamic type and therefore remain invokable as super method calls. The result is a rebased type with subclass semantics.
Note: It is possible to experience unexpected errors in case that the provided levelType and the
corresponding class file get out of sync, i.e. a type is rebased several times without updating the class file.
rebase in class ByteBuddyT - The most specific known type that the created dynamic type represents.levelType - The type which is to be rebased.classFileLocator - A locator for finding a class file that represents a type.methodNameTransformer - The method name transformer that is used for rebasing methods.public ByteBuddy withClassFileVersion(ClassFileVersion classFileVersion)
ByteBuddywithClassFileVersion in class ByteBuddyclassFileVersion - The class file version to define for this configuration.public ByteBuddy withNamingStrategy(NamingStrategy.Unbound namingStrategy)
ByteBuddywithNamingStrategy in class ByteBuddynamingStrategy - The unbound naming strategy to apply to the current configuration.public ByteBuddy withNamingStrategy(NamingStrategy namingStrategy)
ByteBuddywithNamingStrategy in class ByteBuddynamingStrategy - The naming strategy to apply to the current configuration.public ByteBuddy withNamingStrategy(AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy)
ByteBuddywithNamingStrategy in class ByteBuddyauxiliaryTypeNamingStrategy - The naming strategy to use.public ByteBuddy withContext(Implementation.Context.Factory implementationContextFactory)
ByteBuddyImplementation.Context.withContext in class ByteBuddyimplementationContextFactory - The factory to use.public ByteBuddy withModifiers(ModifierContributor.ForType... modifierContributor)
ByteBuddywithModifiers in class ByteBuddymodifierContributor - The modifier contributors to define explicitly for this configuration.public ByteBuddy withAttribute(TypeAttributeAppender typeAttributeAppender)
ByteBuddywithAttribute in class ByteBuddytypeAttributeAppender - The type attribute appender to define for this configuration.public ByteBuddy withTypeAnnotation(Annotation... annotation)
ByteBuddywithTypeAnnotation in class ByteBuddyannotation - The type annotations to define for this configuration.public ByteBuddy withTypeAnnotation(Iterable<? extends Annotation> annotations)
ByteBuddywithTypeAnnotation in class ByteBuddyannotations - The type annotations to define for this configuration.public ByteBuddy withTypeAnnotation(Collection<? extends AnnotationDescription> annotations)
ByteBuddywithTypeAnnotation in class ByteBuddyannotations - The type annotations to define for this configuration.public ByteBuddy.OptionalMethodInterception withImplementing(Class<?>... type)
ByteBuddywithImplementing in class ByteBuddytype - The interface types to implement.public ByteBuddy.OptionalMethodInterception withImplementing(Iterable<? extends Class<?>> types)
ByteBuddywithImplementing in class ByteBuddytypes - The interface types to implement.public ByteBuddy.OptionalMethodInterception withImplementing(TypeDescription... type)
ByteBuddywithImplementing in class ByteBuddytype - The interface types to implement.public ByteBuddy.OptionalMethodInterception withImplementing(Collection<? extends TypeDescription> types)
ByteBuddywithImplementing in class ByteBuddytypes - The interface types to implement.public ByteBuddy withIgnoredMethods(ElementMatcher<? super MethodDescription> ignoredMethods)
ByteBuddywithIgnoredMethods in class ByteBuddyignoredMethods - The methods to always be ignored for any instrumentation.public ByteBuddy withClassVisitor(ClassVisitorWrapper classVisitorWrapper)
ByteBuddyClassVisitors
that are to be applied onto any creation process of a dynamic type.withClassVisitor in class ByteBuddyclassVisitorWrapper - The class visitor wrapper to ba appended to the current chain of class visitor wrappers.public ByteBuddy withMethodGraphCompiler(MethodGraph.Compiler methodGraphCompiler)
ByteBuddywithMethodGraphCompiler in class ByteBuddymethodGraphCompiler - The method graph compiler to use.public ByteBuddy withDefaultFieldAttributeAppender(FieldAttributeAppender.Factory attributeAppenderFactory)
ByteBuddywithDefaultFieldAttributeAppender in class ByteBuddyattributeAppenderFactory - 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)
ByteBuddywithDefaultMethodAttributeAppender in class ByteBuddyattributeAppenderFactory - 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(ElementMatcher<? super MethodDescription> methodMatcher)
ByteBuddypublic DynamicType.Builder<?> makeInterface()
ByteBuddymakeInterface in class ByteBuddypublic <T> DynamicType.Builder<T> makeInterface(Class<T> type)
ByteBuddymakeInterface in class ByteBuddyT - The most specific known type that the created dynamic type represents.type - The interface to extend.public DynamicType.Builder<?> makeInterface(Class<?>... type)
ByteBuddymakeInterface in class ByteBuddytype - The interface types to extend.public DynamicType.Builder<?> makeInterface(TypeDescription... typeDescription)
ByteBuddymakeInterface in class ByteBuddytypeDescription - Descriptions of the interface types to extend.public DynamicType.Builder<?> makeInterface(Iterable<? extends Class<?>> types)
ByteBuddymakeInterface in class ByteBuddytypes - The interface types to extend.public DynamicType.Builder<?> makeInterface(Collection<? extends TypeDescription> typeDescriptions)
ByteBuddymakeInterface in class ByteBuddytypeDescriptions - The interface types to extend.public DynamicType.Builder<? extends Annotation> makeAnnotation()
ByteBuddymakeAnnotation in class ByteBuddypublic DynamicType.Builder<? extends Enum<?>> makeEnumeration(String... value)
ByteBuddymakeEnumeration in class ByteBuddyvalue - The enumeration values to define.public DynamicType.Builder<? extends Enum<?>> makeEnumeration(Collection<? extends String> values)
ByteBuddymakeEnumeration in class ByteBuddyvalues - The enumeration values to define.public DynamicType.Builder<?> makePackage(String name)
ByteBuddymakePackage in class ByteBuddyname - The name of the package.public DynamicType.Builder<?> rebase(Package aPackage, ClassFileLocator classFileLocator)
ByteBuddypublic DynamicType.Builder<?> rebase(PackageDescription packageDescription, ClassFileLocator classFileLocator)
ByteBuddypublic ByteBuddy withTypeAnnotation(AnnotationDescription... annotation)
ByteBuddywithTypeAnnotation in class ByteBuddyannotation - The type annotations to define for this configuration.public ByteBuddy.MatchedMethodInterception invokable(LatentMethodMatcher methodMatcher)
ByteBuddypublic ByteBuddy.MatchedMethodInterception method(ElementMatcher<? super MethodDescription> methodMatcher)
ByteBuddypublic ByteBuddy.MatchedMethodInterception constructor(ElementMatcher<? super MethodDescription> methodMatcher)
ByteBuddyconstructor in class ByteBuddymethodMatcher - The method matcher representing all constructors to intercept.protected abstract ByteBuddy materialize()
Copyright © 2014–2015. All rights reserved.