Class AnnotationDescriptorOrmImpl<A extends Annotation>
java.lang.Object
org.hibernate.models.internal.jdk.AnnotationDescriptorOrmImpl<A>
- All Implemented Interfaces:
AnnotationDescriptor<A>,AnnotationTarget
public class AnnotationDescriptorOrmImpl<A extends Annotation>
extends Object
implements AnnotationDescriptor<A>
AnnotationDescriptor for cases where we do not want to deal with ANNOTATION_TYPE annotations,
most notably, Jakarta and Hibernate annotations
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.models.spi.AnnotationTarget
AnnotationTarget.AnnotationUsageProcessor<T>, AnnotationTarget.Kind -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationDescriptorOrmImpl(Class<A> annotationType, AnnotationDescriptor<?> repeatableContainer) -
Method Summary
Modifier and TypeMethodDescription<X extends Annotation>
voidforEachAnnotationUsage(Class<X> type, Consumer<AnnotationUsage<X>> consumer) Form ofAnnotationTarget.forEachAnnotationUsage(AnnotationDescriptor, Consumer)accepting the annotation Class<X extends Annotation>
voidforEachAnnotationUsage(AnnotationDescriptor<X> type, Consumer<AnnotationUsage<X>> consumer) Access to all the annotations used on this target.The places the described annotation can be usedThe annotation type<X extends Annotation>
AnnotationUsage<X>getAnnotationUsage(Class<X> type) Form ofAnnotationTarget.getAnnotationUsage(AnnotationDescriptor)accepting the annotation Class<X extends Annotation>
AnnotationUsage<X>getAnnotationUsage(AnnotationDescriptor<X> descriptor) Get the usage of the given annotation on this target.The attributes of the annotation<X extends Annotation>
List<AnnotationUsage<? extends Annotation>>getMetaAnnotated(Class<X> metaAnnotationType) Returns all AnnotationUsage references from this target where the usage's annotation class is annotated with the givenmetaAnnotationType.getName()A descriptive name for the target used mostly for logging<X extends Annotation>
AnnotationUsage<X>getNamedAnnotationUsage(Class<X> type, String matchName, String attributeToMatch) <X extends Annotation>
AnnotationUsage<X>getNamedAnnotationUsage(AnnotationDescriptor<X> type, String matchName, String attributeToMatch) Get a usage of the given annotationtypewhoseattributeToMatchattribute value matches the givenmatchName.If the described annotation is repeatable, returns the descriptor for the container annotation.<X extends Annotation>
List<AnnotationUsage<X>>getRepeatedAnnotationUsages(Class<X> type) Form of AnnotationTarget.getRepeatedAnnotationUsages(AnnotationDescriptor) accepting the annotation Class<X extends Annotation>
List<AnnotationUsage<X>>Get all usages of the specifiedannotationTypein this scope.<X extends Annotation>
booleanhasAnnotationUsage(Class<X> type) Whether the given annotation is used on this target.<A extends Annotation>
booleanhasRepeatableAnnotationUsage(Class<A> type) Whether the given annotation is used on this target.booleanWhether the annotation defined as inherited<X extends Annotation>
AnnotationUsage<X>locateAnnotationUsage(Class<X> type) Form of AnnotationTarget.getAnnotationUsage(org.hibernate.models.spi.AnnotationDescriptor<A>) which also considers meta-annotations - annotations on the classes of each local annotation.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.models.spi.AnnotationDescriptor
createUsage, createUsage, findAttribute, getAttribute, getKind, isRepeatableMethods inherited from interface org.hibernate.models.spi.AnnotationTarget
forAllAnnotationUsages, fromAnnotations, getNamedAnnotationUsage, getNamedAnnotationUsage, getSingleAnnotationUsage, getSingleAnnotationUsage
-
Constructor Details
-
AnnotationDescriptorOrmImpl
public AnnotationDescriptorOrmImpl(Class<A> annotationType, AnnotationDescriptor<?> repeatableContainer)
-
-
Method Details
-
getAnnotationType
Description copied from interface:AnnotationDescriptorThe annotation type- Specified by:
getAnnotationTypein interfaceAnnotationDescriptor<A extends Annotation>
-
getAllowableTargets
Description copied from interface:AnnotationDescriptorThe places the described annotation can be used- Specified by:
getAllowableTargetsin interfaceAnnotationDescriptor<A extends Annotation>
-
isInherited
public boolean isInherited()Description copied from interface:AnnotationDescriptorWhether the annotation defined as inherited- Specified by:
isInheritedin interfaceAnnotationDescriptor<A extends Annotation>
-
getRepeatableContainer
Description copied from interface:AnnotationDescriptorIf the described annotation is repeatable, returns the descriptor for the container annotation.- Specified by:
getRepeatableContainerin interfaceAnnotationDescriptor<A extends Annotation>
-
getAttributes
Description copied from interface:AnnotationDescriptorThe attributes of the annotation- Specified by:
getAttributesin interfaceAnnotationDescriptor<A extends Annotation>
-
getName
Description copied from interface:AnnotationTargetA descriptive name for the target used mostly for logging- Specified by:
getNamein interfaceAnnotationTarget
-
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
public <X extends Annotation> AnnotationUsage<X> getAnnotationUsage(AnnotationDescriptor<X> 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
public <X extends Annotation> List<AnnotationUsage<X>> getRepeatedAnnotationUsages(AnnotationDescriptor<X> 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
public <X extends Annotation> void forEachAnnotationUsage(AnnotationDescriptor<X> type, Consumer<AnnotationUsage<X>> consumer) Description copied from interface:AnnotationTarget- Specified by:
forEachAnnotationUsagein interfaceAnnotationTarget
-
forEachAnnotationUsage
public <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
public <X extends Annotation> List<AnnotationUsage<? extends Annotation>> getMetaAnnotated(Class<X> 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
public <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
public <X extends Annotation> AnnotationUsage<X> getNamedAnnotationUsage(Class<X> type, String matchName, String attributeToMatch) Description copied from interface:AnnotationTarget- Specified by:
getNamedAnnotationUsagein interfaceAnnotationTarget
-
toString
-