Package org.hibernate.models.internal
Interface AnnotationTargetSupport
- All Superinterfaces:
AnnotationTarget,MutableAnnotationTarget
- All Known Subinterfaces:
ClassDetailsSupport
- All Known Implementing Classes:
AbstractAnnotationTarget,AbstractAnnotationTarget,AbstractAnnotationTarget,AnnotationDescriptorImpl,DynamicClassDetails,DynamicFieldDetails,DynamicMethodDetails,JandexClassDetails,JandexFieldDetails,JandexMethodDetails,JandexRecordComponentDetails,JdkClassDetails,JdkFieldDetails,JdkMethodDetails,JdkRecordComponentDetails
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.models.spi.AnnotationTarget
AnnotationTarget.AnnotationUsageProcessor<T>, AnnotationTarget.Kind -
Method Summary
Modifier and TypeMethodDescriptiondefault <X extends Annotation>
voidforEachAnnotationUsage(Class<X> type, Consumer<AnnotationUsage<X>> consumer) Form ofAnnotationTarget.forEachAnnotationUsage(AnnotationDescriptor, Consumer)accepting the annotation Classdefault Collection<AnnotationUsage<?>>Access to all the annotations used on this target.default <A extends Annotation>
AnnotationUsage<A>getAnnotationUsage(Class<A> annotationType) Form ofAnnotationTarget.getAnnotationUsage(AnnotationDescriptor)accepting the annotation Classdefault <A extends Annotation>
AnnotationUsage<A>getAnnotationUsage(AnnotationDescriptor<A> descriptor) Get the usage of the given annotation on this target.default <A extends Annotation>
List<AnnotationUsage<? extends Annotation>>getMetaAnnotated(Class<A> metaAnnotationType) Returns all AnnotationUsage references from this target where the usage's annotation class is annotated with the givenmetaAnnotationType.default <X extends Annotation>
AnnotationUsage<X>getNamedAnnotationUsage(Class<X> type, String matchName) default <X extends Annotation>
AnnotationUsage<X>getNamedAnnotationUsage(Class<X> type, String matchName, String attributeToMatch) default <X extends Annotation>
AnnotationUsage<X>getNamedAnnotationUsage(AnnotationDescriptor<X> type, String matchName, String attributeToMatch) Get a usage of the given annotationtypewhoseattributeToMatchattribute value matches the givenmatchName.default <A extends Annotation>
List<AnnotationUsage<A>>getRepeatedAnnotationUsages(Class<A> type) Form of AnnotationTarget.getRepeatedAnnotationUsages(AnnotationDescriptor) accepting the annotation Classdefault <A extends Annotation>
List<AnnotationUsage<A>>Get all usages of the specifiedannotationTypein this scope.Map<Class<? extends Annotation>,AnnotationUsage<? extends Annotation>> default <A extends Annotation>
booleanhasAnnotationUsage(Class<A> type) Whether the given annotation is used on this target.default <A extends Annotation>
booleanhasRepeatableAnnotationUsage(Class<A> type) Whether the given annotation is used on this target.default <A extends Annotation>
AnnotationUsage<A>locateAnnotationUsage(Class<A> annotationType) Form of AnnotationTarget.getAnnotationUsage(org.hibernate.models.spi.AnnotationDescriptor<A>) which also considers meta-annotations - annotations on the classes of each local annotation.Methods inherited from interface org.hibernate.models.spi.AnnotationTarget
forAllAnnotationUsages, forEachAnnotationUsage, fromAnnotations, getKind, getName, getNamedAnnotationUsage, getSingleAnnotationUsage, getSingleAnnotationUsageMethods inherited from interface org.hibernate.models.spi.MutableAnnotationTarget
addAnnotationUsage, applyAnnotationUsage, applyAnnotationUsage, clearAnnotationUsages
-
Method Details
-
getBuildingContext
SourceModelBuildingContext getBuildingContext() -
getUsageMap
Map<Class<? extends Annotation>,AnnotationUsage<? extends Annotation>> getUsageMap() -
getAllAnnotationUsages
Description copied from interface:AnnotationTargetAccess to all the annotations used on this target.- Specified by:
getAllAnnotationUsagesin interfaceAnnotationTarget
-
hasAnnotationUsage
Description copied from interface:AnnotationTargetWhether the given annotation is used on this target.- Specified by:
hasAnnotationUsagein interfaceAnnotationTarget- See Also:
-
hasRepeatableAnnotationUsage
Description copied from interface:AnnotationTargetWhether the given annotation is used on this target.- Specified by:
hasRepeatableAnnotationUsagein interfaceAnnotationTarget- See Also:
-
getAnnotationUsage
default <A extends Annotation> AnnotationUsage<A> getAnnotationUsage(AnnotationDescriptor<A> descriptor) Description copied from interface:AnnotationTargetGet the usage of the given annotation on this target. For repeatable annotation types (e.g.@NamedQuery), this method will either-- if a single repeatable annotation itself is present, it is returned.
-
if the "containing annotation" is present (e.g.
@NamedQueries),- if the container contains just a single repeatable, that one is returned
-
if the container contains multiple repeatables,
AnnotationAccessExceptionwill be thrown
- Specified by:
getAnnotationUsagein interfaceAnnotationTarget- Returns:
- The usage or
null
-
getAnnotationUsage
Description copied from interface:AnnotationTargetForm ofAnnotationTarget.getAnnotationUsage(AnnotationDescriptor)accepting the annotation Class- Specified by:
getAnnotationUsagein interfaceAnnotationTarget
-
locateAnnotationUsage
Description copied from interface:AnnotationTargetForm of AnnotationTarget.getAnnotationUsage(org.hibernate.models.spi.AnnotationDescriptor<A>) which also considers meta-annotations - annotations on the classes of each local annotation.- Specified by:
locateAnnotationUsagein interfaceAnnotationTarget
-
getRepeatedAnnotationUsages
default <A extends Annotation> List<AnnotationUsage<A>> getRepeatedAnnotationUsages(AnnotationDescriptor<A> type) Description copied from interface:AnnotationTargetGet all usages of the specifiedannotationTypein this scope.- Specified by:
getRepeatedAnnotationUsagesin interfaceAnnotationTarget
-
getRepeatedAnnotationUsages
Description copied from interface:AnnotationTargetForm of AnnotationTarget.getRepeatedAnnotationUsages(AnnotationDescriptor) accepting the annotation Class- Specified by:
getRepeatedAnnotationUsagesin interfaceAnnotationTarget
-
forEachAnnotationUsage
default <X extends Annotation> void forEachAnnotationUsage(Class<X> type, Consumer<AnnotationUsage<X>> consumer) Description copied from interface:AnnotationTargetForm ofAnnotationTarget.forEachAnnotationUsage(AnnotationDescriptor, Consumer)accepting the annotation Class- Specified by:
forEachAnnotationUsagein interfaceAnnotationTarget
-
getMetaAnnotated
default <A extends Annotation> List<AnnotationUsage<? extends Annotation>> getMetaAnnotated(Class<A> metaAnnotationType) Description copied from interface:AnnotationTargetReturns all AnnotationUsage references from this target where the usage's annotation class is annotated with the givenmetaAnnotationType. E.g., given the following class and annotationsa call to this method passing@interface TheMeta{ ... }@TheMeta(...)@interface TheAnnotation{ ... }@TheAnnotationclass TheClass{ ... }TheMetaonClassDetails(TheClass)will return the usage of@TheAnnotationonTheClass.- Specified by:
getMetaAnnotatedin interfaceAnnotationTarget
-
getNamedAnnotationUsage
default <X extends Annotation> AnnotationUsage<X> getNamedAnnotationUsage(Class<X> type, String matchName) Description copied from interface:AnnotationTarget- Specified by:
getNamedAnnotationUsagein interfaceAnnotationTarget
-
getNamedAnnotationUsage
default <X extends Annotation> AnnotationUsage<X> getNamedAnnotationUsage(AnnotationDescriptor<X> type, String matchName, String attributeToMatch) Description copied from interface:AnnotationTargetGet a usage of the given annotationtypewhoseattributeToMatchattribute value matches the givenmatchName.- Specified by:
getNamedAnnotationUsagein interfaceAnnotationTargetmatchName- The name to match.attributeToMatch- Name of the attribute to match on.
-
getNamedAnnotationUsage
default <X extends Annotation> AnnotationUsage<X> getNamedAnnotationUsage(Class<X> type, String matchName, String attributeToMatch) Description copied from interface:AnnotationTarget- Specified by:
getNamedAnnotationUsagein interfaceAnnotationTarget
-