| Package | org.granite.validation.constraints |
| Class | public class DecimalMax |
| Inheritance | DecimalMax BaseConstraint |
javax.validation.constraints.DecimalMax annotation
validator.
The annotated element must be a number whose value must be lower or
equal to the specified maximum.
Accepted arguments are:
String that specifies the
payloads with which the constraint declaration is associated (unlike the Java
implementation, payloads are arbitrary Strings and does not represent
necessarily existing class names).org.granite.math.BigDecimalorg.granite.math.BigIntegerorg.granite.math.LongNumber (with possible rounding issues)intuintStringnull elements are considered valid.
Example:
[DecimalMax(message="{my.custom.message}", groups="path.to.MyGroup1, path.to.MyGroup2", value="123.5")]
public function get property():BigDecimal {
...
}") in argument values must be escaped
by using the XML entity (").&) in argument values should be escaped by
using the XML entity (&).<) characters in argument values
must be escaped by using the XML entity (<). All "greater than"
(>) characters in argument values should be escaped by using the XML entity
(>)&space;) in order to keep leading or trailing white spaces in literals.groups)
may use the pseudo XML entity (,) in order to keep comma characters
in literals.| Property | Defined by | ||
|---|---|---|---|
![]() | factory : ValidatorFactory
The
ValidatorFactory passed to the initialized
function. | BaseConstraint | |
![]() | groups : Array
The processing groups with which this constraint is associated as
an array of
Class. | BaseConstraint | |
![]() | message : String
The error message associated with this constraint.
| BaseConstraint | |
![]() | payload : Array
The payload with which this constraint is associated as
an array of
String. | BaseConstraint | |
![]() | properties : Array
The properties with which this constraint is associated as
an array of
String (only for class-level constraints that
deal with one or more properties, in order to figure out where error
messages should be displayed when this constraint fails). | BaseConstraint | |
| value : BigDecimal
[read-only]
The maximum value as specified in the annotation arguments.
| DecimalMax | ||
| Method | Defined by | ||
|---|---|---|---|
|
Initialize this constraint, according to the supplied annotation
parameters.
| DecimalMax | ||
|
validate(value:*):String
Validate the
value parameter, according to this
constraint specification. | DecimalMax | ||
| Constant | Defined by | ||
|---|---|---|---|
| DEFAULT_MESSAGE : String = "{javax.validation.constraints.DecimalMax.message}" [static]
The default message key of this constraint.
| DecimalMax | ||
| value | property |
value:BigDecimal [read-only]The maximum value as specified in the annotation arguments.
Implementation public function get value():BigDecimal
| initialize | () | method |
public override function initialize(annotation:Annotation, factory:ValidatorFactory):void
Initialize this constraint, according to the supplied annotation
parameters.
The org.granite.validation.BaseConstraint
implementation of this method throws an Error
and must be overridden in inherited classes.
annotation:Annotation — the anntotation defining this constraint.
|
|
factory:ValidatorFactory |
| validate | () | method |
public override function validate(value:*):String
Validate the value parameter, according to this
constraint specification.
The org.granite.validation.BaseConstraint
implementation of this method throws an Error
and must be overridden in inherited classes.
value:* — the value to be validated.
|
String — null if the supplied value is valid, an error
message key otherwise.
|
| DEFAULT_MESSAGE | constant |
public static const DEFAULT_MESSAGE:String = "{javax.validation.constraints.DecimalMax.message}"The default message key of this constraint.