public static enum ConstructorStrategy.Default extends Enum<ConstructorStrategy.Default> implements ConstructorStrategy
ConstructorStrategy.Default
Enum Constant and Description |
---|
DEFAULT_CONSTRUCTOR
This strategy is adding a default constructor that calls it's super types default constructor.
|
IMITATE_SUPER_TYPE
This strategy is adding all constructors of the instrumented type's super type where each constructor is
directly invoking its signature-equivalent super type constructor.
|
IMITATE_SUPER_TYPE_PUBLIC
This strategy is adding all constructors of the instrumented type's super type where each constructor is
directly invoking its signature-equivalent super type constructor.
|
NO_CONSTRUCTORS
This strategy is adding no constructors such that the instrumented type will by default not have any.
|
Modifier and Type | Method and Description |
---|---|
MethodRegistry |
inject(MethodRegistry methodRegistry,
MethodAttributeAppender.Factory defaultMethodAttributeAppenderFactory)
Returns a method registry that is capable of creating byte code for the constructors that were
provided by the
ConstructorStrategy.extractConstructors(net.bytebuddy.instrumentation.type.TypeDescription)
method of this instance. |
static ConstructorStrategy.Default |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConstructorStrategy.Default[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
extractConstructors
public static final ConstructorStrategy.Default NO_CONSTRUCTORS
public static final ConstructorStrategy.Default DEFAULT_CONSTRUCTOR
IllegalArgumentException
is thrown. Note that the default constructor
needs to be visible to its sub type for this strategy to work.public static final ConstructorStrategy.Default IMITATE_SUPER_TYPE
public static final ConstructorStrategy.Default IMITATE_SUPER_TYPE_PUBLIC
public
constructors are
added.public static ConstructorStrategy.Default[] values()
for (ConstructorStrategy.Default c : ConstructorStrategy.Default.values()) System.out.println(c);
public static ConstructorStrategy.Default valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic MethodRegistry inject(MethodRegistry methodRegistry, MethodAttributeAppender.Factory defaultMethodAttributeAppenderFactory)
ConstructorStrategy
ConstructorStrategy.extractConstructors(net.bytebuddy.instrumentation.type.TypeDescription)
method of this instance.inject
in interface ConstructorStrategy
methodRegistry
- The original method registry.defaultMethodAttributeAppenderFactory
- The default method attribute appender factory.Copyright © 2014. All rights reserved.