Interface ConversionFinder

All Known Implementing Classes:
MarshallingContext
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

A pluggable strategy for discovering Conversion functions between type pairs.

Implementations are passed to the ConfigurableConverter constructor and are consulted in order before the built-in BasicConverter reflection logic.

Return null from findConversion(Class, Class) to indicate that this finder has no conversion for the given type pair; the next registered finder (or the built-in logic) will be tried instead.

Example:

ConfigurableConverter converter = new ConfigurableConverter( (inType, outType) -> { if (inType == String.class && outType == MyBean.class) return (in, memberOf, session, args) -> MyBean.fromString((String) in); return null; } );

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    findConversion(Class<?> inType, Class<?> outType)
    Returns a Conversion for the specified input/output type pair, or null if this finder has no conversion for the pair.
  • Method Details

    • findConversion

      Conversion<?,?> findConversion(Class<?> inType, Class<?> outType)
      Returns a Conversion for the specified input/output type pair, or null if this finder has no conversion for the pair.
      Parameters:
      inType - The input type class.
      outType - The output type class.
      Returns:
      A Conversion function, or null if no conversion is available.