java.lang.Object
st.orm.spi.DefaultORMReflectionImpl
- All Implemented Interfaces:
ORMReflection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<Constructor<?>> findCanonicalConstructor(Class<? extends Record> type) Returns the canonical constructor for the specified record type.findPKType(Class<? extends Record> recordType) 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.getRecordType(Object clazz) 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.booleanisSupportedType(Object clazz)
-
Constructor Details
-
DefaultORMReflectionImpl
public DefaultORMReflectionImpl()
-
-
Method Details
-
findCanonicalConstructor
Description copied from interface:ORMReflectionReturns 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.
- Specified by:
findCanonicalConstructorin interfaceORMReflection- Parameters:
type- the record type.- Returns:
- the record components of the specified record type.
-
findPKType
Description copied from interface:ORMReflectionReturns the primary key type for the specified record type, if available.- Specified by:
findPKTypein interfaceORMReflection- Parameters:
recordType- 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
public boolean isAnnotationPresent(@Nonnull RecordComponent component, @Nonnull Class<? extends Annotation> annotationType) Description copied from interface:ORMReflectionChecks if the specified record component has the specified annotation.- Specified by:
isAnnotationPresentin interfaceORMReflection- 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
public boolean isAnnotationPresent(@Nonnull Class<?> type, @Nonnull Class<? extends Annotation> annotationType) Description copied from interface:ORMReflectionChecks if the specified type has the specified annotation.- Specified by:
isAnnotationPresentin interfaceORMReflection- 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
public <A extends Annotation> A getAnnotation(@Nonnull RecordComponent component, @Nonnull Class<A> annotationType) Description copied from interface:ORMReflectionReturns the annotation of the specified type for the specified record component, if present.- Specified by:
getAnnotationin interfaceORMReflection- 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
public <A extends Annotation> A[] getAnnotations(@Nonnull RecordComponent component, @Nonnull Class<A> annotationType) Description copied from interface:ORMReflectionReturns the annotations of the specified type for the specified record component, supporting repeatable annotations.- Specified by:
getAnnotationsin interfaceORMReflection- 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
public <A extends Annotation> A getAnnotation(@Nonnull Class<?> type, @Nonnull Class<A> annotationType) Description copied from interface:ORMReflectionReturns the annotation of the specified type for the specified type, if present.- Specified by:
getAnnotationin interfaceORMReflection- 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.
-
getType
- Specified by:
getTypein interfaceORMReflection
-
getRecordType
- Specified by:
getRecordTypein interfaceORMReflection
-
isDefaultValue
- Specified by:
isDefaultValuein interfaceORMReflection
-
isSupportedType
- Specified by:
isSupportedTypein interfaceORMReflection
-
isNonnull
Description copied from interface:ORMReflectionReturns true if the specified component has a non-null annotation, false otherwise.- Specified by:
isNonnullin interfaceORMReflection- 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
Description copied from interface:ORMReflectionReturns the permitted subclasses of the specified sealed class.- Specified by:
getPermittedSubclassesin interfaceORMReflection- Parameters:
sealedClass- the sealed class to get the permitted subclasses for.- Returns:
- a list of permitted subclasses of the specified sealed class.
-
invokeComponent
public Object invokeComponent(@Nonnull RecordComponent component, @Nonnull Object record) throws Throwable - Specified by:
invokeComponentin interfaceORMReflection- Throws:
Throwable
-
isDefaultMethod
- Specified by:
isDefaultMethodin interfaceORMReflection
-
execute
public Object execute(@Nonnull Object proxy, @Nonnull Method method, Object... args) throws Throwable - Specified by:
executein interfaceORMReflection- Throws:
Throwable
-