Package st.orm

Annotation Interface Convert


@Target({RECORD_COMPONENT,PARAMETER}) @Retention(RUNTIME) public @interface Convert
Declares how a Converter should be applied.

This annotation supports three use cases:

  • Explicit converter Specify a concrete converter class through converter() when a component type has multiple applicable converters or when auto-apply is not desired.
  • Disable conversion Set disableConversion() to true to prevent any auto-apply or inherited converter from being used.
  • Fallback to auto-apply When the annotation is not present, Storm will attempt to resolve a single matching converter where autoApply() == true.

If both converter() and disableConversion() are set in a conflicting way, conversion resolution will fail with a clear error.

Since:
1.7
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the converter to be applied.
    boolean
    Used to disable an auto-apply or inherited converter.
  • Element Details

    • converter

      Class<?> converter
      Specifies the converter to be applied. A value for this element must be specified if multiple converters would otherwise apply.
      Default:
      java.lang.Void.class
    • disableConversion

      boolean disableConversion
      Used to disable an auto-apply or inherited converter. If disableConversion is true, the converter element should not be specified.
      Default:
      false