AnnotatedArrayType — 배열 타입의 애너테이션 가능 사용 인터페이스

AnnotatedArrayType — 배열 타입의 애너테이션 가능 사용 인터페이스

AnnotatedArrayType는 배열 타입의 잠재적으로 애너테이션된 사용(potentially annotated use)을 나타내요. 배열의 컴포넌트 타입 자체가 타입의 애너테이션된 사용을 나타낼 수 있어요. 이 인터페이스는 AnnotatedType을 확장해요.

출처: Java API Reference

본문

AnnotatedType getAnnotatedGenericComponentType() — 이 배열의 컴포넌트 타입(요소 타입)을 나타내는 AnnotatedType을 반환해요. 예를 들어 @Foo String @Bar []에서 컴포넌트 타입은 @Foo StringAnnotatedType이에요.

AnnotatedType getAnnotatedOwnerType() — 배열 타입에는 일반적으로 소유자(owner) 타입이 없으므로 null을 반환하도록 기본 구현이 제공돼요.

이 인터페이스는 Field.getAnnotatedType(), Method.getAnnotatedReturnType() 등이 반환하며, 배열 타입이 붙은 타입 애너테이션(type annotation)을 리플렉션으로 조사하는 데 사용돼요.

더 알아보기 (Learn more)