I have a standalone enum type defined, something like this:
package my.pkg.types;
public enum MyEnumType {
TYPE1,
TYPE2
}
Now, I w
Use the value child element instead of the value attribute and specify the Enum class name:
ALIEN
The advantage of this approach over just writing value="ALIEN"
is that it also works if Spring can't infer the actual type of the enum from the property (e.g. the property's declared type is an interface).Adapted from araqnid's comment.