정리 방법을 알아 내려고하는 기존 코드가 있습니다. 내가 생각한 한 가지 해결책은 내가 주어진 enum 값을 기반으로 사용자 정의 처리기를 삽입 할 수 있다는 것입니다. enum을 기반으로 한 Injection을받을 수 있습니까? 나는 이런 식으로 생각하고있다. (의사 코드)Enum에 기반한 주사를 맞출 수 있습니까?
@Service(MyEnum.MYVALUE, MyEnum.MYOTHERVALUE) // produces a handler given these enums
public class MyHandler { ... }
@Service(MyEnum.ANOTHERVALUE)
public class AnotherHandler {... }
// .... some mystical way of telling spring what my current enum context is so I can get the right handler
실제로'@Service' 매개 변수가 열거 형이라고 제안하지 않았으므로 "의사 코드"라고 말했고, 내가 찾고있는 코드가 무엇인지 확실하지 않았습니다. – xenoterracide