This topic has not yet been written. The content below is from the topic description.
2.1.1. Field-level constraints Constraints can be expressed by annotating a field of a class. Example 2.1, “Field level constraint” shows a field level configuration example: Example 2.1. Field level constraint package com.mycompany; import javax.validation.constraints.NotNull; public class Car { @NotNull private String manufacturer; @AssertTrue private boolean isRegistered; public Car(String manufacturer, boolean isRegistered) { super(); this.manufacturer = manufacturer; this.isRegistered = isRegistered; } } When using field level constraints field access strategy is used to access the value to be validated. This means the bean validation provider directly accesses the instance variable and does not invoke the property accessor method also if such a method exists. Note The access type (private, protected or public) does not matter. Note Static fields and properties cannot be validated.