- All Known Implementing Classes:
DefaultORMReflectionImpl
public interface ORMReflection
Provides pluggable reflection support for the ORM to support different JVM languages, such as Java and Kotlin.
-
Method Summary
Modifier and TypeMethodDescriptionOptional<Constructor<?>> findCanonicalConstructor(Class<? extends Record> type) Returns the canonical constructor for the specified record type.findPKType(Class<? extends Record> type) Returns the primary key type for the specified record type, if available.<A extends Annotation>
AgetAnnotation(Class<?> type, Class<A> annotationType) Returns the annotation of the specified type for the specified type, if present.<A extends Annotation>
AgetAnnotation(RecordComponent component, Class<A> annotationType) Returns the annotation of the specified type for the specified record component, if present.<A extends Annotation>
A[]getAnnotations(RecordComponent component, Class<A> annotationType) Returns the annotations of the specified type for the specified record component, supporting repeatable annotations.getPermittedSubclasses(Class<?> sealedClass) Returns the permitted subclasses of the specified sealed class.Class<?> invokeComponent(RecordComponent component, Object record) booleanisAnnotationPresent(Class<?> type, Class<? extends Annotation> annotationType) Checks if the specified type has the specified annotation.booleanisAnnotationPresent(RecordComponent component, Class<? extends Annotation> annotationType) Checks if the specified record component has the specified annotation.booleanisDefaultMethod(Method method) booleanbooleanisNonnull(RecordComponent component) Returns true if the specified component has a non-null annotation, false otherwise.boolean
-
Method Details
-
findCanonicalConstructor
Returns the canonical constructor for the specified record type.The canonical constructor is the base constructor that is used to create new instances of the record type.
- Parameters:
type- the record type.- Returns:
- the record components of the specified record type.
-
findPKType
Returns the primary key type for the specified record type, if available.- Parameters:
type- the record type.- Returns:
- the primary key type for the specified record type, or an empty optional if no primary key type is available.
-
isAnnotationPresent
boolean isAnnotationPresent(@Nonnull RecordComponent component, @Nonnull Class<? extends Annotation> annotationType) Checks if the specified record component has the specified annotation.- Parameters:
component- the record component to check for the specified annotation.annotationType- the annotation type to check for.- Returns:
- true if the specified record component has the specified annotation, false otherwise.
-
isAnnotationPresent
boolean isAnnotationPresent(@Nonnull Class<?> type, @Nonnull Class<? extends Annotation> annotationType) Checks if the specified type has the specified annotation.- Parameters:
type- the type to check for the specified annotation.annotationType- the annotation type to check for.- Returns:
- true if the specified type has the specified annotation, false otherwise.
-
getAnnotation
<A extends Annotation> A getAnnotation(@Nonnull RecordComponent component, @Nonnull Class<A> annotationType) Returns the annotation of the specified type for the specified record component, if present.- Type Parameters:
A- the annotation type.- Parameters:
component- the record component to get the annotation from.annotationType- the annotation type to get.- Returns:
- the annotation of the specified type for the specified record component, or
nullif not present.
-
getAnnotations
<A extends Annotation> A[] getAnnotations(@Nonnull RecordComponent component, @Nonnull Class<A> annotationType) Returns the annotations of the specified type for the specified record component, supporting repeatable annotations.- Type Parameters:
A- the annotation type.- Parameters:
component- the record component to get the annotation from.annotationType- the annotation type to get.- Returns:
- the annotation of the specified type for the specified record component, or
nullif not present.
-
getAnnotation
Returns the annotation of the specified type for the specified type, if present.- Type Parameters:
A- the annotation type.- Parameters:
type- the type to get the annotation from.annotationType- the annotation type to get.- Returns:
- the annotation of the specified type for the specified type, or
nullif not present.
-
isSupportedType
-
getType
-
getRecordType
-
isDefaultValue
-
isNonnull
Returns true if the specified component has a non-null annotation, false otherwise.- Parameters:
component- the component to check for a non-null annotation.- Returns:
- true if the specified component has a non-null annotation, false otherwise.
-
getPermittedSubclasses
Returns the permitted subclasses of the specified sealed class.- Parameters:
sealedClass- the sealed class to get the permitted subclasses for.- Returns:
- a list of permitted subclasses of the specified sealed class.
-
invokeComponent
- Throws:
Throwable
-
isDefaultMethod
-
execute
- Throws:
Throwable
-