Given a class containing an enum:
public class MyClass {
public enum NestedEnum {
value1(1),
value2(2);
private int code;
private NestedEnum(int code) {
this.code = code;
}
public int getCode() {
return code;
}
}
}
how do I reference NestedEnum? This:
#{T(MyClass.NestedEnum).value1.getCode()}
results in the exception:
org.springframework.expression.spel.SpelEvaluationException: EL1005E:(pos 0): Type cannot be found 'namespace.MyClass.NestedEnum'
This:
#{T(T(MyClass).NestedEnum).value1.getCode()}
results in the exception:
org.springframework.expression.spel.SpelParseException: EL1043E:(pos 3): Unexpected token. Expected 'rparen())' but was 'lparen(()'
I cannot think of any other good options to try.