tech.ydb.yoj.databind.schema.reflect.Reflector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yoj-databind Show documentation
Show all versions of yoj-databind Show documentation
Core data-binding logic used by YOJ (YDB ORM for Java) to convert
between Java objects and database rows (or anything representable by
a Java Map, really).
The newest version!
package tech.ydb.yoj.databind.schema.reflect;
import tech.ydb.yoj.databind.FieldValueType;
import java.lang.reflect.Type;
/**
* Common interface for slightly different reflection logic (for Java POJOs, Java records, Kotlin data classes etc.)
* used in YOJ data-binding to build a {@link tech.ydb.yoj.databind.schema.Schema schema} with
* {@link tech.ydb.yoj.databind.schema.Schema.JavaField fields}.
*/
public interface Reflector {
/**
* Gets reflection information for a root type, that is, a type that can have a
* {@link tech.ydb.yoj.databind.schema.Schema schema}: a public concrete class.
*
* @param type type to get reflection information for
* @param type to get reflection information for
* @return basic reflection information for {@code type}
*/
ReflectType reflectRootType(Class type);
/**
* Gets reflection information for a field, potentially a deep sub-field of some type which can have schema.
*
* @param genericType generic type of field to get reflection information for
* @param bindingType value type suitable for data-binding of type {@code genericType}
* @return basic reflection information for the field
*/
ReflectType> reflectFieldType(Type genericType, FieldValueType bindingType);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy