public static enum Around.ProxyTargetConstructorMode extends Enum<Around.ProxyTargetConstructorMode>
Factorymethod if the returned bean features constructor arguments this can lead to undefined behaviour since it is expected with factory methods that the developer is responsible for constructing the object.
For example if the type accepts an argument of type
String then there is no way
for Micronaut to know what to inject as a value for the argument and injecting
null is inherently unsafe.
Around.ProxyTargetConstructorMode allows the developer decide if they wish to allow
proxies to be constructed and if a proxy is allowed then Micronaut will either inject a bean if it is found or
null if is not. For primitive types Micronaut will inject
true for booleans and
0 for number types
|Enum Constant and Description|
Allow types to be proxied and don't print any warnings.
Do not allow types with constructor arguments to be proxied.
Allow types to be proxied but print a warning when this feature is used.
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
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
public static final Around.ProxyTargetConstructorMode ERROR
public static final Around.ProxyTargetConstructorMode WARN
In this case if a constructor parameter cannot be injected Micronaut will inject
null for objects or
false for boolean or
0 for any other primitive.
public static final Around.ProxyTargetConstructorMode ALLOW
public static Around.ProxyTargetConstructorMode values()
for (Around.ProxyTargetConstructorMode c : Around.ProxyTargetConstructorMode.values()) System.out.println(c);
public static Around.ProxyTargetConstructorMode valueOf(String name)