If the logic only applies for one method it is usually better to use this instead of creating a new annotation for it.
This is triggered by annotating the method that should be validated like so:
@RequiresValid("xyz") public void xyz() {...}
This causes isValid("xyz") to be called. The isValid() method can use the name to determine which set of logic is to be applied. Typically the provided string will correspond to the name of the interaction, but this is not strictly necessary. It is possible to combine several annotations on one method, if desired:
@RequiresValid("allowed") @RequiresValid("officehours") public void xyz() {...}
The validation occurs both when a Resource is computed for the resource as a whole, and when an actual invocation of an interaction is made.
|
|