Annotation Type UseJsonSerializer


@Retention(RUNTIME)
@Target({METHOD,TYPE})
@Repeatable(UseJsonSerializers.class)
public @interface UseJsonSerializer
This annotation can be used to register a JsonSerializer for the underlying Jackson JSON parser.

The annotation can be placed on

  • a test method
  • the class that declares the test method
  • the method SamplerFixture.defineSamplers()
  • the class that defines the method defineSamplers
If UseJsonSerializer is used at more than one of the aforementioned places, and several of them define JsonSerializers for the same type, the ones on top of the aforementioned list, override the lower ones.
  • Required Element Summary

    Required Elements
    Modifier and Type Required Element Description
    java.lang.Class<?> forType
    The Class for which the serializer should be used.
    java.lang.Class<? extends com.fasterxml.jackson.databind.JsonSerializer<?>> serializer
    Defines the concrete class of the JsonSerializer
  • Element Details

    • serializer

      java.lang.Class<? extends com.fasterxml.jackson.databind.JsonSerializer<?>> serializer
      Defines the concrete class of the JsonSerializer
      Returns:
      the concrete class of the JsonSerializer
    • forType

      java.lang.Class<?> forType
      The Class for which the serializer should be used.
      Returns:
      The Class for which the serializer should be used.