Package org.hibernate.models.spi
Interface MutableAnnotationTarget
- All Superinterfaces:
AnnotationTarget
- All Known Subinterfaces:
AnnotationTargetSupport,ClassDetailsSupport,MutableClassDetails,MutableMemberDetails
- All Known Implementing Classes:
AbstractAnnotationDescriptor,AbstractAnnotationTarget,AbstractAnnotationTarget,AbstractJdkAnnotationTarget,DynamicClassDetails,DynamicFieldDetails,JdkClassDetails,JdkFieldDetails,JdkMethodDetails,JdkRecordComponentDetails,OrmAnnotationDescriptor,StandardAnnotationDescriptor
Extension of AnnotationTarget which allows manipulation of the annotations
-
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 TypeMethodDescription<X extends Annotation>
voidaddAnnotationUsage(X annotationUsage) Add an annotation usage to this targetdefault <A extends Annotation>
AapplyAnnotationUsage(AnnotationDescriptor<A> annotationType, ModelsContext modelContext) Applies a usage of the givenannotationTypeto this target.voidRemoves all annotation usages currently associated with this target.<X extends Annotation>
voidremoveAnnotationUsage(AnnotationDescriptor<X> annotationType) Remove an annotation, by type, from this target if there is such a usage.default <A extends Annotation>
AreplaceAnnotationUsage(AnnotationDescriptor<A> annotationType, ModelsContext modelContext) Creates and replaces (if any) an existing usage of the given annotation.<S extends Annotation,P extends Annotation>
PreplaceAnnotationUsage(AnnotationDescriptor<S> repeatableType, AnnotationDescriptor<P> containerType, ModelsContext modelContext) Creates and replaces (if any) an existing usage of the given annotation.Methods inherited from interface org.hibernate.models.spi.AnnotationTarget
asAnnotationDescriptor, asFieldDetails, asMethodDetails, asRecordComponentDetails, forEachAnnotationUsage, forEachAnnotationUsage, forEachDirectAnnotationUsage, forEachRepeatedAnnotationUsages, forEachRepeatedAnnotationUsages, fromAnnotations, fromContainers, fromSelfAndContainers, getAnnotationUsage, getAnnotationUsage, getContainer, getDirectAnnotationUsage, getDirectAnnotationUsage, getDirectAnnotationUsages, getKind, getMetaAnnotated, getName, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getRepeatedAnnotationUsages, getRepeatedAnnotationUsages, hasAnnotationUsage, hasDirectAnnotationUsage, locateAnnotationUsage, walkContainers, walkSelfAndContainers
-
Method Details
-
clearAnnotationUsages
void clearAnnotationUsages()Removes all annotation usages currently associated with this target. Useful for complete XML mappings. -
addAnnotationUsage
Add an annotation usage to this target -
removeAnnotationUsage
Remove an annotation, by type, from this target if there is such a usage. -
applyAnnotationUsage
default <A extends Annotation> A applyAnnotationUsage(AnnotationDescriptor<A> annotationType, ModelsContext modelContext) Applies a usage of the givenannotationTypeto this target. Will return an existing usage, if one, or create a new usage. -
replaceAnnotationUsage
default <A extends Annotation> A replaceAnnotationUsage(AnnotationDescriptor<A> annotationType, ModelsContext modelContext) Creates and replaces (if any) an existing usage of the given annotation. For repeatable annotations, use replaceAnnotationUsage(AnnotationDescriptor, AnnotationDescriptor, ModelsContext) instead.- See Also:
- API Note:
- Generally replacement is used with XML processing and, again generally, only for repeatable annotations using replaceAnnotationUsage(AnnotationDescriptor, AnnotationDescriptor, ModelsContext)
-
replaceAnnotationUsage
<S extends Annotation,P extends Annotation> P replaceAnnotationUsage(AnnotationDescriptor<S> repeatableType, AnnotationDescriptor<P> containerType, ModelsContext modelContext) Creates and replaces (if any) an existing usage of the given annotation. For repeatable annotations, use Applies a usage of the givenannotationTypeto this target. Will return an existing usage, if one, or create a new usage.- See Also:
-
asClassDetails
MutableClassDetails asClassDetails()Description copied from interface:AnnotationTarget- Specified by:
asClassDetailsin interfaceAnnotationTarget
-
asMemberDetails
MutableMemberDetails asMemberDetails()Description copied from interface:AnnotationTarget- Specified by:
asMemberDetailsin interfaceAnnotationTarget
-