Package org.hibernate.models.spi
Interface AnnotationDescriptor<A extends Annotation>
- All Superinterfaces:
AnnotationTarget
- All Known Implementing Classes:
AnnotationDescriptorImpl,AnnotationDescriptorOrmImpl
Describes an annotation type (the Class)
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.models.spi.AnnotationTarget
AnnotationTarget.AnnotationUsageProcessor<T>, AnnotationTarget.Kind -
Method Summary
Modifier and TypeMethodDescriptiondefault MutableAnnotationUsage<A>createUsage(AnnotationTarget target, Consumer<MutableAnnotationUsage<A>> adjuster, SourceModelBuildingContext context) Create a usage of this annotation with all attribute values defaulted, allowing customization prior to return.default MutableAnnotationUsage<A>createUsage(AnnotationTarget target, SourceModelBuildingContext context) Create a usage of this annotation with all attribute values defaulted.default <V> AttributeDescriptor<V>findAttribute(String name) Get an attribute descriptor by name, returningnullif the name is not an attribute of the described annotation.The places the described annotation can be usedThe annotation typedefault <V> AttributeDescriptor<V>getAttribute(String name) Get an attribute descriptor by name.The attributes of the annotationdefault AnnotationTarget.KindgetKind()The kind of targetIf the described annotation is repeatable, returns the descriptor for the container annotation.booleanWhether the annotation defined as inheriteddefault booleanWhether the annotation is repeatable.Methods inherited from interface org.hibernate.models.spi.AnnotationTarget
forAllAnnotationUsages, forEachAnnotationUsage, forEachAnnotationUsage, fromAnnotations, getAllAnnotationUsages, getAnnotationUsage, getAnnotationUsage, getMetaAnnotated, getName, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getRepeatedAnnotationUsages, getRepeatedAnnotationUsages, getSingleAnnotationUsage, getSingleAnnotationUsage, hasAnnotationUsage, hasRepeatableAnnotationUsage, locateAnnotationUsage
-
Method Details
-
getKind
Description copied from interface:AnnotationTargetThe kind of target- Specified by:
getKindin interfaceAnnotationTarget
-
getAnnotationType
The annotation type -
getAllowableTargets
EnumSet<AnnotationTarget.Kind> getAllowableTargets()The places the described annotation can be used -
isInherited
boolean isInherited()Whether the annotation defined as inherited -
isRepeatable
default boolean isRepeatable()Whether the annotation is repeatable. -
getRepeatableContainer
AnnotationDescriptor<?> getRepeatableContainer()If the described annotation is repeatable, returns the descriptor for the container annotation. -
getAttributes
List<AttributeDescriptor<?>> getAttributes()The attributes of the annotation -
findAttribute
Get an attribute descriptor by name, returningnullif the name is not an attribute of the described annotation. -
getAttribute
Get an attribute descriptor by name.- Throws:
UnknownAnnotationAttributeException- if the name is not an attribute of the described annotation.
-
createUsage
default MutableAnnotationUsage<A> createUsage(AnnotationTarget target, SourceModelBuildingContext context) Create a usage of this annotation with all attribute values defaulted.- Parameters:
target- The target of the annotation being created. May generally benull.context- Access to needed services
-
createUsage
default MutableAnnotationUsage<A> createUsage(AnnotationTarget target, Consumer<MutableAnnotationUsage<A>> adjuster, SourceModelBuildingContext context) Create a usage of this annotation with all attribute values defaulted, allowing customization prior to return.- Parameters:
target- The target of the annotation being created. May generally benull.adjuster- Callback to allow adjusting the created usage prior to return.context- Access to needed services
-