Class ConstructorStrategy.Default.WithMethodAttributeAppenderFactory
java.lang.Object
net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy.Default.WithMethodAttributeAppenderFactory
- All Implemented Interfaces:
ConstructorStrategy
- Enclosing class:
- ConstructorStrategy.Default
@Enhance
protected static class ConstructorStrategy.Default.WithMethodAttributeAppenderFactory
extends Object
implements ConstructorStrategy
A wrapper for a default constructor strategy which additionally applies a method attribute appender factory.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy
ConstructorStrategy.Default, ConstructorStrategy.ForDefaultConstructor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConstructorStrategy.Default
The delegate default constructor strategy.private final MethodAttributeAppender.Factory
The method attribute appender factory to apply. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
WithMethodAttributeAppenderFactory
(ConstructorStrategy.Default delegate, MethodAttributeAppender.Factory methodAttributeAppenderFactory) Creates a new wrapper for a default constructor strategy. -
Method Summary
Modifier and TypeMethodDescriptionextractConstructors
(TypeDescription instrumentedType) Extracts constructors for a given super type.inject
(TypeDescription instrumentedType, MethodRegistry methodRegistry) Returns a method registry that is capable of creating byte code for the constructors that were provided by theConstructorStrategy.extractConstructors(TypeDescription)
method of this instance.
-
Field Details
-
delegate
The delegate default constructor strategy. -
methodAttributeAppenderFactory
The method attribute appender factory to apply.
-
-
Constructor Details
-
WithMethodAttributeAppenderFactory
protected WithMethodAttributeAppenderFactory(ConstructorStrategy.Default delegate, MethodAttributeAppender.Factory methodAttributeAppenderFactory) Creates a new wrapper for a default constructor strategy.- Parameters:
delegate
- The delegate default constructor strategy.methodAttributeAppenderFactory
- The method attribute appender factory to apply.
-
-
Method Details
-
extractConstructors
Extracts constructors for a given super type. The extracted constructor signatures will then be imitated by the created dynamic type.- Specified by:
extractConstructors
in interfaceConstructorStrategy
- Parameters:
instrumentedType
- The type for which the constructors should be created.- Returns:
- A list of tokens that describe the constructors that are to be implemented.
-
inject
Returns a method registry that is capable of creating byte code for the constructors that were provided by theConstructorStrategy.extractConstructors(TypeDescription)
method of this instance.- Specified by:
inject
in interfaceConstructorStrategy
- Parameters:
instrumentedType
- The instrumented type.methodRegistry
- The original method registry.- Returns:
- A method registry that is capable of providing byte code for the constructors that were added by this strategy.
-