Package org.springframework.test.context
Enum TestConstructor.AutowireMode
- java.lang.Object
- java.lang.Enum<TestConstructor.AutowireMode>
- org.springframework.test.context.TestConstructor.AutowireMode
- All Implemented Interfaces:
Serializable
,Comparable<TestConstructor.AutowireMode>
- Enclosing class:
- TestConstructor
public static enum TestConstructor.AutowireMode extends Enum<TestConstructor.AutowireMode>
Defines autowiring modes for parameters in a test constructor.
Enum Constant Summary
Enum Constants Enum Constant Description ALL
All test constructor parameters will be autowired as if the constructor itself were annotated with@Autowired
.ANNOTATED
Each individual test constructor parameter will only be autowired if it is annotated with@Autowired
,@Qualifier
, or@Value
, or if the constructor itself is annotated with@Autowired
.
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TestConstructor.AutowireMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static TestConstructor.AutowireMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Enum Constant Detail
ALL
public static final TestConstructor.AutowireMode ALL
All test constructor parameters will be autowired as if the constructor itself were annotated with@Autowired
.- See Also:
ANNOTATED
ANNOTATED
public static final TestConstructor.AutowireMode ANNOTATED
Each individual test constructor parameter will only be autowired if it is annotated with@Autowired
,@Qualifier
, or@Value
, or if the constructor itself is annotated with@Autowired
.- See Also:
ALL
Method Detail
values
public static TestConstructor.AutowireMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TestConstructor.AutowireMode c : TestConstructor.AutowireMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
valueOf
public static TestConstructor.AutowireMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null