Package org.hibernate.models.internal
Class SimpleClassDetails
java.lang.Object
org.hibernate.models.internal.SimpleClassDetails
- All Implemented Interfaces:
AnnotationTarget,ClassDetails,TypeVariableScope
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.models.spi.AnnotationTarget
AnnotationTarget.AnnotationUsageProcessor<T>, AnnotationTarget.KindNested classes/interfaces inherited from interface org.hibernate.models.spi.ClassDetails
ClassDetails.ClassDetailsConsumer -
Field Summary
Fields inherited from interface org.hibernate.models.spi.ClassDetails
CLASS_CLASS_DETAILS, OBJECT_CLASS_DETAILS, VOID_CLASS_DETAILS, VOID_OBJECT_CLASS_DETAILS -
Constructor Summary
ConstructorsConstructorDescriptionSimpleClassDetails(Class<?> clazz) SimpleClassDetails(Class<?> clazz, ClassDetails superClassDetails, TypeDetails genericSuperTypeDetails) -
Method Summary
Modifier and TypeMethodDescription<X extends Annotation>
voidforEachAnnotationUsage(Class<X> type, Consumer<AnnotationUsage<X>> consumer) Form ofAnnotationTarget.forEachAnnotationUsage(AnnotationDescriptor, Consumer)accepting the annotation ClassvoidforEachField(IndexedConsumer<FieldDetails> consumer) Visit each fieldvoidforEachMethod(IndexedConsumer<MethodDetails> consumer) Visit each methodAccess to all the annotations used on this target.<A extends Annotation>
AnnotationUsage<A>getAnnotationUsage(Class<A> type) Form ofAnnotationTarget.getAnnotationUsage(AnnotationDescriptor)accepting the annotation Class<A extends Annotation>
AnnotationUsage<A>getAnnotationUsage(AnnotationDescriptor<A> descriptor) Get the usage of the given annotation on this target.The name of theClass, ornullfor dynamic models.Get the fields for this classDetails for the interfaces this class implements.<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.Get the methods for this classgetName()The name of the class.<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.Get the record components for this class<A extends Annotation>
List<AnnotationUsage<A>>getRepeatedAnnotationUsages(Class<A> type) Form of AnnotationTarget.getRepeatedAnnotationUsages(AnnotationDescriptor) accepting the annotation Class<A extends Annotation>
List<AnnotationUsage<A>>Get all usages of the specifiedannotationTypein this scope.Details for the class that is the super type for this class.Access to the type parameters associated with this class.<A extends Annotation>
booleanhasAnnotationUsage(Class<A> 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 class should be considered abstract.booleanisImplementor(Class<?> checkType) Whether the described class is an implementor of the givencheckType.booleanisRecord()Where the class is a Java recordbooleanWhether the Class, if one, represented by this ClassDetails is already loaded on the ClassLoader used for loading.<A extends Annotation>
AnnotationUsage<A>locateAnnotationUsage(Class<A> type) Form of AnnotationTarget.getAnnotationUsage(org.hibernate.models.spi.AnnotationDescriptor<A>) which also considers meta-annotations - annotations on the classes of each local annotation.<X> Class<X>Know what you are doing before calling this methodtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.models.spi.AnnotationTarget
forAllAnnotationUsages, forEachAnnotationUsage, fromAnnotations, getNamedAnnotationUsage, getNamedAnnotationUsage, getSingleAnnotationUsage, getSingleAnnotationUsageMethods inherited from interface org.hibernate.models.spi.ClassDetails
determineRawClass, findField, findFieldByName, findRecordComponent, findRecordComponentByName, forEachSuper, forSelfAndEachSuper, getKind, isSuperclass, resolveTypeVariable
-
Constructor Details
-
SimpleClassDetails
-
SimpleClassDetails
public SimpleClassDetails(Class<?> clazz, ClassDetails superClassDetails, TypeDetails genericSuperTypeDetails)
-
-
Method Details
-
getName
Description copied from interface:ClassDetailsThe name of the class. Generally this is the same as the class name. But in the case of Hibernate'sentity-namefeature, this would be theentity-name- Specified by:
getNamein interfaceAnnotationTarget- Specified by:
getNamein interfaceClassDetails
-
getClassName
Description copied from interface:ClassDetailsThe name of theClass, ornullfor dynamic models.- Specified by:
getClassNamein interfaceClassDetails
-
getSuperClass
Description copied from interface:ClassDetailsDetails for the class that is the super type for this class.- Specified by:
getSuperClassin interfaceClassDetails
-
getGenericSuperType
- Specified by:
getGenericSuperTypein interfaceClassDetails
-
toJavaClass
Description copied from interface:ClassDetailsKnow what you are doing before calling this method- Specified by:
toJavaClassin interfaceClassDetails
-
toString
-
isResolved
public boolean isResolved()Description copied from interface:ClassDetailsWhether the Class, if one, represented by this ClassDetails is already loaded on the ClassLoader used for loading.- Specified by:
isResolvedin interfaceClassDetails- Returns:
truewhen there is a physical backing class, and it is loaded;falseotherwise.
-
isAbstract
public boolean isAbstract()Description copied from interface:ClassDetailsWhether the class should be considered abstract.- Specified by:
isAbstractin interfaceClassDetails
-
isRecord
public boolean isRecord()Description copied from interface:ClassDetailsWhere the class is a Java record- Specified by:
isRecordin interfaceClassDetails
-
getImplementedInterfaces
Description copied from interface:ClassDetailsDetails for the interfaces this class implements.- Specified by:
getImplementedInterfacesin interfaceClassDetails
-
getTypeParameters
Description copied from interface:ClassDetailsAccess to the type parameters associated with this class.- Specified by:
getTypeParametersin interfaceClassDetails
-
isImplementor
Description copied from interface:ClassDetailsWhether the described class is an implementor of the givencheckType.- Specified by:
isImplementorin interfaceClassDetails
-
getFields
Description copied from interface:ClassDetailsGet the fields for this class- Specified by:
getFieldsin interfaceClassDetails
-
forEachField
Description copied from interface:ClassDetailsVisit each field- Specified by:
forEachFieldin interfaceClassDetails
-
getMethods
Description copied from interface:ClassDetailsGet the methods for this class- Specified by:
getMethodsin interfaceClassDetails
-
forEachMethod
Description copied from interface:ClassDetailsVisit each method- Specified by:
forEachMethodin interfaceClassDetails
-
getRecordComponents
Description copied from interface:ClassDetailsGet the record components for this class- Specified by:
getRecordComponentsin interfaceClassDetails
-
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 <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
public <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
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 <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
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
-