annotation(2)
-
[Spring] Interface를 구현한 Class 검색
나 같은 경우 서브업무로 업무가 분리되어 있는 경우 업무를 처리하고 특정 Interface를 구현한 Class를 찾아서 후처리하는 기능 때문에 필요한 기능이었습니다.추가적으로 찾은 Class에서 특정 Annotaion을 사용한 Method를 찾아서 실행하도록 하였습니다. ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false); provider.addIncludeFilter(new AssignableTypeFilter(Interface명.class));Set components = provider.findCandidateComponents("Package명"); //..
2019.04.15 -
Custom Validation Annotion 생성
Spring에서 코드성을 체크하는 validation 없어서 생성하기로 맘먹고 구글링 시작....^ ^ package com.company.common.validation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import javax.validation.Constraint; import javax.validation.Payload; @Documented @Constraint(validat..
2015.08.26