JavaPlayFramework.beanValidation.mustache Maven / Gradle / Ivy
{{#required}}
@NotNull
{{/required}}
{{#pattern}}
@Pattern(regexp="{{{.}}}")
{{/pattern}}
{{#minLength}}
{{#maxLength}}
@Size(min={{minLength}},max={{maxLength}})
{{/maxLength}}
{{/minLength}}
{{#minLength}}
{{^maxLength}}
@Size(min={{minLength}})
{{/maxLength}}
{{/minLength}}
{{^minLength}}
{{#maxLength}}
@Size(max={{.}})
{{/maxLength}}
{{/minLength}}
{{#minItems}}
{{#maxItems}}
@Size(min={{minItems}},max={{maxItems}})
{{/maxItems}}
{{/minItems}}
{{#minItems}}
{{^maxItems}}
@Size(min={{minItems}})
{{/maxItems}}
{{/minItems}}
{{^minItems}}
{{#maxItems}}
@Size(max={{.}})
{{/maxItems}}
{{/minItems}}
{{! check for integer / number=decimal type}}
{{#isInteger}}
{{#minimum}}
@Min({{.}})
{{/minimum}}
{{#maximum}}
@Max({{.}})
{{/maximum}}
{{/isInteger}}
{{^isInteger}}
{{#minimum}}
@DecimalMin("{{.}}")
{{/minimum}}
{{#maximum}}
@DecimalMax("{{.}}")
{{/maximum}}
{{/isInteger}}
{{^isPrimitiveType}}
@Valid
{{/isPrimitiveType}}