1
바인딩 및 주석에 관한 질문이 있습니다.AbstractModule을 구현하는 클래스에서 주석 객체를 테스트하는 방법
public class MailFacadeImpl implements MailFacade {
private final PersonDao personDao;
@Inject
public MailFacadeImpl(@Mail PersonDao personDao) {
super();
this.personDao = personDao;
}
PersonDao는 사용자 정의 주석 주석이 :
나는 다음과 같은 클래스가 있습니다. AbstractModule을 구현하는 클래스 내부에서이 주석을 테스트 할 수 있기를 원합니다.if(PersonDAO is annotated with(Mail.class)){
bind(new TypeLiteral<SecurityRulesFactory<Person>>(){}).toProvider(FactoryProvider.newFactory(
new TypeLiteral<SecurityRulesFactory<Person>>(){}, new TypeLiteral<MailSecurityRulesCrdb>(){}));
}
당신이 그것을 가능하다고 생각하십니까 :
bind(new TypeLiteral<SecurityRulesFactory<Person>>(){}).toProvider(FactoryProvider.newFactory(
new TypeLiteral<SecurityRulesFactory<Person>>(){}, new TypeLiteral<MailSecurityRulesCrdb>(){}));
I과 유사한 뭔가를해야만하고 싶은 : 여기
코드의 조각인가?도움을 주신 분들 :-) 멋진 금요일 되세요!
이 파일을 찾았습니다 : PersonDao.class.isAnnotationPresent (Mail.class). 어쩌면 작동 할 수도 있습니다. 내가 시험해 볼게. – AbstractMan