@Retention(value=RUNTIME) @Target(value=METHOD) public @interface ExpressionValidator
Annotation usage:
The annotation must be applied at method level.
Annotation parameters:
Parameter | Required | Default | Notes |
---|---|---|---|
message | yes | field error message | |
key | no | i18n key from language specific properties file. | |
messageParams | no | Additional params to be used to customize message - will be evaluated against the Value Stack | |
shortCircuit | no | false | If this validator should be used as shortCircuit. |
expression | yes | An OGNL expression that returns a boolean value. |
Example code:
@ExpressionValidator(message = "Default message", key = "i18n.key", shortCircuit = true, expression = "an OGNL expression" )
Modifier and Type | Required Element and Description |
---|---|
String |
expression |
Modifier and Type | Optional Element and Description |
---|---|
String |
key |
String |
message |
String[] |
messageParams |
boolean |
shortCircuit
If this is activated, the validator will be used as short-circuit.
|
public abstract String expression
public abstract String message
public abstract String key
public abstract String[] messageParams
public abstract boolean shortCircuit
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.