Package org.hibernate.models.spi
Interface AnnotationDescriptor<A extends Annotation>
- All Superinterfaces:
AnnotationTarget,Storable<AnnotationDescriptor<A>,SerialAnnotationDescriptor<A>>
- All Known Subinterfaces:
MutableAnnotationDescriptor<A,C>
- All Known Implementing Classes:
AbstractAnnotationDescriptor,OrmAnnotationDescriptor,StandardAnnotationDescriptor
public interface AnnotationDescriptor<A extends Annotation>
extends AnnotationTarget, Storable<AnnotationDescriptor<A>,SerialAnnotationDescriptor<A>>
Describes an annotation type (the Class)
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.models.spi.AnnotationTarget
AnnotationTarget.AnnotationUsageProcessor<T,A extends Annotation>, AnnotationTarget.Kind -
Method Summary
Modifier and TypeMethodDescriptiondefault <S> Sdefault <X extends Annotation>
AnnotationDescriptor<X> Safe cast method for cases when the target is an annotation.default ClassDetailsdefault FieldDetailsdefault MemberDetailsdefault MethodDetailsdefault RecordComponentDetailsSafe cast method for cases when the target is a record component.createUsage(A jdkAnnotation, ModelsContext context) Create a usage from the JDK representation.default AcreateUsage(Map<String, Object> attributeValues, ModelsContext context) Create a usage from the JDK representation.createUsage(ModelsContext context) Create an empty usage.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 ClassDetailsgetContainer(ModelsContext modelsContext) Get the ClassDetails for the class which is the "container" for this target. For a member (org.hib.Thing#id), this will be the declaring type (org.hib.Thing).default 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.default SerialAnnotationDescriptor<A> Methods inherited from interface org.hibernate.models.spi.AnnotationTarget
forEachAnnotationUsage, forEachAnnotationUsage, forEachDirectAnnotationUsage, forEachRepeatedAnnotationUsages, forEachRepeatedAnnotationUsages, fromAnnotations, fromContainers, fromSelfAndContainers, getAnnotationUsage, getAnnotationUsage, getDirectAnnotationUsage, getDirectAnnotationUsage, getDirectAnnotationUsages, getMetaAnnotated, getName, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getRepeatedAnnotationUsages, getRepeatedAnnotationUsages, hasAnnotationUsage, hasDirectAnnotationUsage, locateAnnotationUsage, walkContainers, walkSelfAndContainers
-
Method Details
-
getKind
Description copied from interface:AnnotationTargetThe kind of target- Specified by:
getKindin interfaceAnnotationTarget
-
getAnnotationType
The annotation type -
as
-
getContainer
Description copied from interface:AnnotationTargetGet the ClassDetails for the class which is the "container" for this target.- For a member (
org.hib.Thing#id), this will be the declaring type (org.hib.Thing). - For a class (
org.hib.Thing), this will be the ClassDetails for its package (org.hib.package-info) - For a package (
org.hib.package-info), this will be the ClassDetails for the containing package (org.package-info)
- Specified by:
getContainerin interfaceAnnotationTarget
- For a member (
-
createUsage
Create an empty usage. Used when there is no source form, such as XML processing. -
createUsage
Create a usage from the JDK representation. This will often just return the passed annotation, although for Hibernate and JPA annotations we generally want wrappers to be able to manipulate the values. -
createUsage
Create a usage from the JDK representation. This will often just return the passed annotation, although for Hibernate and JPA annotations we generally want wrappers to be able to manipulate the values. -
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.
-
asAnnotationDescriptor
Description copied from interface:AnnotationTargetSafe cast method for cases when the target is an annotation.- Specified by:
asAnnotationDescriptorin interfaceAnnotationTarget
-
asClassDetails
Description copied from interface:AnnotationTarget- Specified by:
asClassDetailsin interfaceAnnotationTarget
-
asMemberDetails
Description copied from interface:AnnotationTarget- Specified by:
asMemberDetailsin interfaceAnnotationTarget
-
asFieldDetails
Description copied from interface:AnnotationTarget- Specified by:
asFieldDetailsin interfaceAnnotationTarget
-
asMethodDetails
Description copied from interface:AnnotationTarget- Specified by:
asMethodDetailsin interfaceAnnotationTarget
-
asRecordComponentDetails
Description copied from interface:AnnotationTargetSafe cast method for cases when the target is a record component.- Specified by:
asRecordComponentDetailsin interfaceAnnotationTarget
-
toStorableForm
- Specified by:
toStorableFormin interfaceStorable<AnnotationDescriptor<A extends Annotation>,SerialAnnotationDescriptor<A extends Annotation>>
-