Class Validator

java.lang.Object
dev.relism.flash.ext.validation.Validator

public final class Validator extends Object
The compiled constraints of one type. Built once per class and reused for every request.

verify(java.lang.Object) allocates nothing when a value passes: the loop walks an array (no iterator), reads fields through exact-signature MethodHandles (no boxing, no argument array), and compares against operands resolved at compile time. The violation list and the exception are constructed only once something actually fails.

  • Method Details

    • isEmpty

      public boolean isEmpty()
      True when the type declares no constraints at all — verify(java.lang.Object) is then a no-op.
    • verify

      public void verify(Object target)
      Verifies every constraint on target.
      Throws:
      ValidationException - with all failures, never just the first