U - The most specific known loaded type that is implemented by the created dynamic type, usually the
type itself, an interface or the direct super class.protected abstract class DynamicType.Builder.AbstractBase.AbstractDelegatingBuilder<U> extends Object implements DynamicType.Builder<U>
DynamicType.Builder.AbstractBase<S>, DynamicType.Builder.ExceptionDeclarableMethodInterception<S>, DynamicType.Builder.FieldAnnotationTarget<S>, DynamicType.Builder.FieldValueTarget<S>, DynamicType.Builder.MatchedMethodInterception<T>, DynamicType.Builder.MethodAnnotationTarget<S>, DynamicType.Builder.OptionalMatchedMethodInterception<S>| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDelegatingBuilder() |
| Modifier and Type | Method and Description |
|---|---|
DynamicType.Builder<U> |
annotateType(Annotation... annotation)
Adds annotations to the currently constructed type.
|
DynamicType.Builder<U> |
attribute(TypeAttributeAppender attributeAppender)
Adds an attribute appender to the currently constructed type which will be applied on the creation of
the type.
|
DynamicType.Builder<U> |
bridgeMethodResolverFactory(BridgeMethodResolver.Factory bridgeMethodResolverFactory)
Defines a bridge method resolver factory to be applied to this type creation.
|
DynamicType.Builder<U> |
classFileVersion(ClassFileVersion classFileVersion)
Defines a class file format version for this builder for which the dynamic types should be created.
|
DynamicType.Builder<U> |
classVisitor(ClassVisitorWrapper classVisitorWrapper)
Adds an additional ASM
ClassVisitor to this builder which will be applied in
the construction process of this dynamic type. |
DynamicType.Builder.MatchedMethodInterception<U> |
constructor(ElementMatcher<? super MethodDescription> methodMatcher)
Selects a set of constructors of this type for instrumentation.
|
DynamicType.Builder.ExceptionDeclarableMethodInterception<U> |
defineConstructor(Iterable<Class<?>> parameterTypes,
ModifierContributor.ForMethod... modifier)
Defines a new constructor for this type.
|
DynamicType.Builder.ExceptionDeclarableMethodInterception<U> |
defineConstructor(List<? extends TypeDescription> parameterTypes,
ModifierContributor.ForMethod... modifier)
Defines a new constructor for this type.
|
DynamicType.Builder.FieldValueTarget<U> |
defineField(String name,
Class<?> fieldType,
ModifierContributor.ForField... modifier)
Defines a new field for this type.
|
DynamicType.Builder.FieldValueTarget<U> |
defineField(String name,
TypeDescription fieldTypeDescription,
ModifierContributor.ForField... modifier)
Defines a new field for this type.
|
DynamicType.Builder.ExceptionDeclarableMethodInterception<U> |
defineMethod(String name,
Class<?> returnType,
List<Class<?>> parameterTypes,
ModifierContributor.ForMethod... modifier)
Defines a new method for this type.
|
DynamicType.Builder.ExceptionDeclarableMethodInterception<U> |
defineMethod(String name,
TypeDescription returnType,
List<? extends TypeDescription> parameterTypes,
ModifierContributor.ForMethod... modifier)
Defines a new method for this type.
|
DynamicType.Builder<U> |
ignoreMethods(ElementMatcher<? super MethodDescription> ignoredMethods)
Defines a matcher for methods that will be ignored for any interception attempt.
|
DynamicType.Builder.OptionalMatchedMethodInterception<U> |
implement(Class<?>... interfaceType)
Adds an interface to be implemented the created type.
|
DynamicType.Builder.OptionalMatchedMethodInterception<U> |
implement(TypeDescription... interfaceType)
Adds an interface to be implemented the created type.
|
DynamicType.Builder.MatchedMethodInterception<U> |
invokable(ElementMatcher<? super MethodDescription> methodMatcher)
Selects a set of byte code methods of this type for instrumentation.
|
DynamicType.Unloaded<U> |
make()
Creates the dynamic type without loading it.
|
protected abstract DynamicType.Builder<U> |
materialize()
Materializes the current state of the build before applying another modification.
|
DynamicType.Builder.MatchedMethodInterception<U> |
method(ElementMatcher<? super MethodDescription> methodMatcher)
Selects a set of methods of this type for instrumentation.
|
DynamicType.Builder<U> |
methodLookupEngine(MethodLookupEngine.Factory methodLookupEngineFactory)
Defines the use of a specific factory for a
MethodLookupEngine. |
DynamicType.Builder<U> |
modifiers(ModifierContributor.ForType... modifier)
Defines modifiers for the created dynamic type.
|
DynamicType.Builder<U> |
name(NamingStrategy namingStrategy)
Names the currently created dynamic type by the given naming strategy.
|
DynamicType.Builder<U> |
name(String name)
Names the currently created dynamic type by a fixed name.
|
public DynamicType.Builder<U> classFileVersion(ClassFileVersion classFileVersion)
DynamicType.BuilderclassFileVersion in interface DynamicType.Builder<U>classFileVersion - The class format version for the dynamic type to implement.public DynamicType.Builder.OptionalMatchedMethodInterception<U> implement(Class<?>... interfaceType)
DynamicType.Builderimplement in interface DynamicType.Builder<U>interfaceType - The interface to implement.public DynamicType.Builder.OptionalMatchedMethodInterception<U> implement(TypeDescription... interfaceType)
DynamicType.Builderimplement in interface DynamicType.Builder<U>interfaceType - A description of the interface to implement.public DynamicType.Builder<U> name(String name)
DynamicType.Buildername in interface DynamicType.Builder<U>name - A fully qualified name to give to the created dynamic type.public DynamicType.Builder<U> name(NamingStrategy namingStrategy)
DynamicType.Buildername in interface DynamicType.Builder<U>namingStrategy - The naming strategy to apply.public DynamicType.Builder<U> modifiers(ModifierContributor.ForType... modifier)
DynamicType.Buildermodifiers in interface DynamicType.Builder<U>modifier - A collection of modifiers to be reflected by the created dynamic type.public DynamicType.Builder<U> ignoreMethods(ElementMatcher<? super MethodDescription> ignoredMethods)
DynamicType.BuilderignoreMethods in interface DynamicType.Builder<U>ignoredMethods - A method matcher characterizing the methods to be ignored.public DynamicType.Builder<U> attribute(TypeAttributeAppender attributeAppender)
DynamicType.Builderattribute in interface DynamicType.Builder<U>attributeAppender - An attribute appender to be applied onto the currently created type.public DynamicType.Builder<U> annotateType(Annotation... annotation)
DynamicType.BuilderNote: The annotations will not be visible to
Instrumentations.annotateType in interface DynamicType.Builder<U>annotation - The annotations to be added to the currently constructed type.public DynamicType.Builder<U> classVisitor(ClassVisitorWrapper classVisitorWrapper)
DynamicType.BuilderClassVisitor to this builder which will be applied in
the construction process of this dynamic type.classVisitor in interface DynamicType.Builder<U>classVisitorWrapper - The wrapper delegate for the ASM class visitor.public DynamicType.Builder<U> methodLookupEngine(MethodLookupEngine.Factory methodLookupEngineFactory)
DynamicType.BuilderMethodLookupEngine.methodLookupEngine in interface DynamicType.Builder<U>methodLookupEngineFactory - The factory to be used.public DynamicType.Builder<U> bridgeMethodResolverFactory(BridgeMethodResolver.Factory bridgeMethodResolverFactory)
DynamicType.BuilderbridgeMethodResolverFactory in interface DynamicType.Builder<U>bridgeMethodResolverFactory - The bridge method resolver factory that is to be used.public DynamicType.Builder.FieldValueTarget<U> defineField(String name, Class<?> fieldType, ModifierContributor.ForField... modifier)
DynamicType.BuilderdefineField in interface DynamicType.Builder<U>name - The name of the method.fieldType - The type of this field where the current type can be represented by
TargetType.modifier - The modifiers for this method.public DynamicType.Builder.FieldValueTarget<U> defineField(String name, TypeDescription fieldTypeDescription, ModifierContributor.ForField... modifier)
DynamicType.BuilderdefineField in interface DynamicType.Builder<U>name - The name of the method.fieldTypeDescription - The type of this field where the current type can be represented by
TargetType.modifier - The modifiers for this method.public DynamicType.Builder.ExceptionDeclarableMethodInterception<U> defineMethod(String name, Class<?> returnType, List<Class<?>> parameterTypes, ModifierContributor.ForMethod... modifier)
DynamicType.BuilderNote that a method definition overrides any method of identical signature that was defined in a super type what is only valid if the method is of at least broader visibility and if the overridden method is not
final.defineMethod in interface DynamicType.Builder<U>name - The name of the method.returnType - The return type of the method where the current type can be represented by
TargetType.parameterTypes - The parameter types of this method where the current type can be represented by
TargetType.modifier - The modifiers for this method.public DynamicType.Builder.ExceptionDeclarableMethodInterception<U> defineMethod(String name, TypeDescription returnType, List<? extends TypeDescription> parameterTypes, ModifierContributor.ForMethod... modifier)
DynamicType.BuilderNote that a method definition overrides any method of identical signature that was defined in a super type what is only valid if the method is of at least broader visibility and if the overridden method is not
final.defineMethod in interface DynamicType.Builder<U>name - The name of the method.returnType - A description of the return type of the method where the current type can be
represented by TargetType.parameterTypes - Descriptions of the parameter types of this method where the current type can be
represented by TargetType.modifier - The modifiers for this method.public DynamicType.Builder.ExceptionDeclarableMethodInterception<U> defineConstructor(Iterable<Class<?>> parameterTypes, ModifierContributor.ForMethod... modifier)
DynamicType.Builderstatic. Instead, a static type
initializer is added automatically if such an initializer is required. See
ElementMatchers.isTypeInitializer() for a matcher for this initializer
which can be intercepted using
DynamicType.Builder.invokable(net.bytebuddy.matcher.ElementMatcher).
Note that a constructor's implementation must call another constructor of the same class or a constructor of its super class. This constructor call must be hardcoded inside of the constructor's method body. Before this constructor call is made, it is not legal to call any methods or to read any fields of the instance under construction.
defineConstructor in interface DynamicType.Builder<U>parameterTypes - The parameter types of this constructor where the current type can be represented by
TargetType.modifier - The modifiers for this constructor.public DynamicType.Builder.ExceptionDeclarableMethodInterception<U> defineConstructor(List<? extends TypeDescription> parameterTypes, ModifierContributor.ForMethod... modifier)
DynamicType.Builderstatic. Instead, a static type
initializer is added automatically if such an initializer is required. See
ElementMatchers.isTypeInitializer() for a matcher for this initializer
which can be intercepted using
DynamicType.Builder.invokable(net.bytebuddy.matcher.ElementMatcher).
Note that a constructor's implementation must call another constructor of the same class or a constructor of its super class. This constructor call must be hardcoded inside of the constructor's method body. Before this constructor call is made, it is not legal to call any methods or to read any fields of the instance under construction.
defineConstructor in interface DynamicType.Builder<U>parameterTypes - The parameter types of this constructor where the current type can be represented by
TargetType.modifier - The modifiers for this constructor.public DynamicType.Builder.MatchedMethodInterception<U> method(ElementMatcher<? super MethodDescription> methodMatcher)
DynamicType.Buildermethod in interface DynamicType.Builder<U>methodMatcher - A matcher describing the methods to be intercepted by this instrumentation.public DynamicType.Builder.MatchedMethodInterception<U> constructor(ElementMatcher<? super MethodDescription> methodMatcher)
DynamicType.Builderconstructor in interface DynamicType.Builder<U>methodMatcher - A matcher describing the constructors to be intercepted by this instrumentation.public DynamicType.Builder.MatchedMethodInterception<U> invokable(ElementMatcher<? super MethodDescription> methodMatcher)
DynamicType.Builderinvokable in interface DynamicType.Builder<U>methodMatcher - A matcher describing the byte code methods to be intercepted by this instrumentation.public DynamicType.Unloaded<U> make()
DynamicType.Buildermake in interface DynamicType.Builder<U>protected abstract DynamicType.Builder<U> materialize()
Copyright © 2014. All rights reserved.