Class JacksonModelValidator

java.lang.Object
org.graylog2.jackson.JacksonModelValidator

public class JacksonModelValidator extends Object
Validates model or DTO objects for correct annotation usage. It mainly checks if the configured annotations for subtypes use the correct settings.
  • Constructor Details

    • JacksonModelValidator

      public JacksonModelValidator()
  • Method Details

    • check

      public static void check(String collectionName, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<?> clazz)
      Validates a class by inspecting its Jackson specific annotations. Can be used to validate classes on application startup. The bean serializer modifier only runs when the first object serialization happens.
      Parameters:
      collectionName - the collection name that the given class is stored in
      objectMapper - the Jackson object mapper
      clazz - the class that should be validated
    • getBeanSerializerModifier

      public static com.fasterxml.jackson.databind.ser.BeanSerializerModifier getBeanSerializerModifier()