Interface ConversionContext

All Known Implementing Classes:
ConverterRegistry.Context

public interface ConversionContext
Immutable conversion location, with recursive dispatch through the same module registry. Paths are whole keys: a key containing a dot is never split.
Since:
6.3.0
  • Method Details

    • file

      String file()
      Returns:
      the configuration file's module-relative name
    • path

      List<String> path()
      Returns:
      an immutable list of whole path segments
    • declaredType

      Type declaredType()
      Returns:
      the declared Java type, including generic arguments
    • toPlain

      Object toPlain(Object nested) throws ConversionException
      Converts a nested Java value using its runtime type and the same registry.
      Parameters:
      nested - the nested Java value
      Returns:
      plain data
      Throws:
      ConversionException - when conversion fails
    • fromPlain

      <V> V fromPlain(Object nested, Type type) throws ConversionException
      Converts a nested document value through the same registry.
      Type Parameters:
      V - the result type
      Parameters:
      nested - the nested document value
      type - the declared nested Java type
      Returns:
      the converted nested value
      Throws:
      ConversionException - when conversion fails