• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

섹션6 필터, 커스텀 어노테이션 관련 질문입니다.

24.01.25 13:42 작성 조회수 78

1

@Component와 같은 기능을 수행하는 어노테이션 생성 시

@Component내부에 있는

@Rentation(RentationPolicy.RUNTIME)

@Target(ElementType.Type)

@Documented

위 3가지를 가져다 붙여서

 

@Rentation(RentationPolicy.RUNTIME)
@Target(ElementType.Type)
@Documented
public @interface MyIncludeComponent{
}

로 작성하라 하셨는데

@Component
public @interface MyIncludeComponent{
}

위와 같이 작성은 불가능한가요?

답변 1

답변을 작성해보세요.

1

안녕하세요. iky1505님

Java에서 어노테이션은 상속이나 구현을 통해 다른 어노테이션의 특성을 상속받을 수 없습니다.

따라서 정상 작동하지 않습니다.

감사합니다.