Package org.hibernate.models.spi
Interface ClassDetails
- All Superinterfaces:
AnnotationTarget,TypeVariableScope
- All Known Subinterfaces:
ClassDetailsSupport,MutableClassDetails
- All Known Implementing Classes:
DynamicClassDetails,JandexClassDetails,JdkClassDetails,SimpleClassDetails
Abstraction for what Hibernate understands about a "class", generally before it has access to
the actual
Class reference, if there is a Class at all (dynamic models).- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.hibernate.models.spi.AnnotationTarget
AnnotationTarget.AnnotationUsageProcessor<T>, AnnotationTarget.Kind -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassDetailsDetails forClass.classstatic final ClassDetailsDetails forObject.classstatic final ClassDetailsDetails forvoid.classstatic final ClassDetailsDetails forVoid.class -
Method Summary
Modifier and TypeMethodDescriptiondefault ClassDetailsDetermine the raw class for the given type.default FieldDetailsfindField(Predicate<FieldDetails> check) Find a field by checkdefault FieldDetailsfindFieldByName(String name) Find a field by namedefault RecordComponentDetailsFind a record component by checkdefault RecordComponentDetailsFind a record component by namevoidforEachField(IndexedConsumer<FieldDetails> consumer) Visit each fieldvoidforEachMethod(IndexedConsumer<MethodDetails> consumer) Visit each methoddefault voidWalk our super-classes passing each to theconsumerdefault voidPass ourselves into theconsumerand then the same for each super classThe name of theClass, ornullfor dynamic models.Get the fields for this classDetails for the interfaces this class implements.default AnnotationTarget.KindgetKind()The kind of targetGet the methods for this classgetName()The name of the class.Get the record components for this classDetails for the class that is the super type for this class.Access to the type parameters associated with this class.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.default booleanisSuperclass(ClassDetails classDetails) Returnstrueis the provided classDetails is a superclass of this class,falseotherwisedefault TypeDetailsresolveTypeVariable(TypeVariableDetails typeVariable) Resolve the type of the provided type variable relative to this scope.<X> Class<X>Know what you are doing before calling this methodMethods inherited from interface org.hibernate.models.spi.AnnotationTarget
forAllAnnotationUsages, forEachAnnotationUsage, forEachAnnotationUsage, fromAnnotations, getAllAnnotationUsages, getAnnotationUsage, getAnnotationUsage, getMetaAnnotated, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getNamedAnnotationUsage, getRepeatedAnnotationUsages, getRepeatedAnnotationUsages, getSingleAnnotationUsage, getSingleAnnotationUsage, hasAnnotationUsage, hasRepeatableAnnotationUsage, locateAnnotationUsage
-
Field Details
-
OBJECT_CLASS_DETAILS
Details forObject.class -
CLASS_CLASS_DETAILS
Details forClass.class -
VOID_CLASS_DETAILS
Details forvoid.class -
VOID_OBJECT_CLASS_DETAILS
Details forVoid.class
-
-
Method Details
-
getKind
Description copied from interface:AnnotationTargetThe kind of target- Specified by:
getKindin interfaceAnnotationTarget
-
getName
String getName()The 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
-
getClassName
String getClassName()The name of theClass, ornullfor dynamic models.- API Note:
- Will be
nullfor dynamic models
-
isResolved
boolean isResolved()Whether the Class, if one, represented by this ClassDetails is already loaded on the ClassLoader used for loading.- Returns:
truewhen there is a physical backing class, and it is loaded;falseotherwise.
-
isAbstract
boolean isAbstract()Whether the class should be considered abstract. -
isRecord
boolean isRecord()Where the class is a Java record -
getSuperClass
ClassDetails getSuperClass()Details for the class that is the super type for this class. -
getGenericSuperType
TypeDetails getGenericSuperType() -
getImplementedInterfaces
List<TypeDetails> getImplementedInterfaces()Details for the interfaces this class implements. -
getTypeParameters
List<TypeVariableDetails> getTypeParameters()Access to the type parameters associated with this class. -
forEachSuper
Walk our super-classes passing each to theconsumer -
forSelfAndEachSuper
Pass ourselves into theconsumerand then the same for each super class -
isSuperclass
Returnstrueis the provided classDetails is a superclass of this class,falseotherwise -
resolveTypeVariable
Description copied from interface:TypeVariableScopeResolve the type of the provided type variable relative to this scope. For example, givenclass
A call to this method on theThing<I extends Number>{ I id; }Thingscope with the type variable representingIwill return theI extends Numbertype variable definition itself. If this scope defines a corresponding type argument, the concrete type is returned. For example, givenclass
This method will yield theStuff extends Thing<Integer>{ }Integertype details.- Specified by:
resolveTypeVariablein interfaceTypeVariableScope- Parameters:
typeVariable- The type variable to resolve- Returns:
- The type variable's resolved type, or
nullif none could be found
-
determineRawClass
Description copied from interface:TypeVariableScopeDetermine the raw class for the given type. Never returnsnull, opting to return Object instead if the raw class is not known- Specified by:
determineRawClassin interfaceTypeVariableScope- Returns:
- The raw class details, or Object if "not known".
-
isImplementor
Whether the described class is an implementor of the givencheckType. -
getFields
List<FieldDetails> getFields()Get the fields for this class -
forEachField
Visit each field -
findField
Find a field by check -
findFieldByName
Find a field by name -
getMethods
List<MethodDetails> getMethods()Get the methods for this class -
forEachMethod
Visit each method -
getRecordComponents
List<RecordComponentDetails> getRecordComponents()Get the record components for this class -
findRecordComponent
Find a record component by check -
findRecordComponentByName
Find a record component by name -
toJavaClass
Know what you are doing before calling this method
-