Class ValidationGenerator

java.lang.Object
dk.mada.jaxrs.generator.mpclient.ValidationGenerator

public class ValidationGenerator extends Object
Validation generator. Prepared bean validation contexts for template rendering.
  • Constructor Details

    • ValidationGenerator

      public ValidationGenerator(GeneratorOpts opts)
      Constructs new instance.
      Parameters:
      opts - the generator options
  • Method Details

    • makeValidation

      public Optional<CtxValidation> makeValidation(Imports imports, Type type, @Nullable Validation validation)
      Generate validation rendering context from type and validation information.
      Parameters:
      imports - the api/dto imports
      type - the type to make validation for
      validation - the reference validation information
      Returns:
      an optional validation rendering context
    • makeRequired

      public CtxValidation makeRequired()
      Returns a validation context for required values.
      Returns:
      a validation context for required values