Interface ReflectField

All Known Implementing Classes:
KotlinDataClassComponent, PojoField, RecordField

public interface ReflectField
Basic reflection information about a field of a type with a schema, or more generally, its read-only property.
  • Method Details

    • getName

      String getName()
      Returns:
      field name as it appears in code (or the closest thing to it). Can only contain valid Java identifier characters, e.g. cannot have a "."
    • getColumn

      @Nullable Column getColumn()
      Returns:
      @Column annotation, if this field is annotated; null otherwise. Precisely what means "field is annotated" is implementation-dependent: it might mean that the property getter method is annotated, for example.
    • getGenericType

      Type getGenericType()
      Returns:
      full generic field type
      See Also:
    • getType

      Class<?> getType()
      Returns:
      raw field type
      See Also:
    • getReflectType

      ReflectType<?> getReflectType()
      Returns:
      basic reflection information for raw field type
    • getValue

      @Nullable Object getValue(Object containingObject)
      Parameters:
      containingObject - object which contains this field
      Returns:
      value of this field for containingObject; might be null.
      This method will throw when invoked on a containingObject that is not instanceof getType().
    • getChildren

      default Collection<ReflectField> getChildren()
      Returns:
      subfields of this field, if any; might be empty
    • getValueType

      FieldValueType getValueType()
      Returns this field's value type for the purposes of data-binding. The type returned is very vague, e.g., all POJOs and Java records will have type of COMPOSITE meaning they will be mapped into multiple columns by default; all fixed-size integral values will have type of INTEGER; and so on.

      @Column annotation can influence whether a multi-field type such as a POJO is mapped to one column or multiple columns, see its JavaDoc for more information.

      Returns:
      field's value type for the purposes of data-binding