org.loom.annotation.validation
Annotation Type NumberValidation


@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER})
@Documented
public @interface NumberValidation

Number validation rules


Optional Element Summary
 boolean bindMessages
          true if the any error message should be bound to this field, false to use unbound Messages
 java.lang.String[] except
          the list of events in which this validation does NOT place, empty for none.
 boolean excludeMax
          true to exclude the maximum in the valid interval, default false
 boolean excludeMin
          true to exclude the minimum in the valid interval, default false
 java.lang.String maxValue
          maximum allowed value, ex: "200.1"
 java.lang.String message
          the key of the message that will be displayed if the validator does not pass, leave empty for default
 java.lang.String minValue
          minimum allowed value, ex: "100.1".
 java.lang.String[] on
          the list of events in which this validation takes place, empty for all.
 int precision
          how many digits
 java.lang.String propertyPath
          if provided, applies to the property path instead of the annotated property
 int scale
          how many decimal digits, set to -1 to disable.
 

propertyPath

public abstract java.lang.String propertyPath
if provided, applies to the property path instead of the annotated property

Default:
""

on

public abstract java.lang.String[] on
the list of events in which this validation takes place, empty for all. Accepts wildcards.

Default:
{}

except

public abstract java.lang.String[] except
the list of events in which this validation does NOT place, empty for none. Accepts wildcards.

Default:
{}

message

public abstract java.lang.String message
the key of the message that will be displayed if the validator does not pass, leave empty for default

Default:
""

bindMessages

public abstract boolean bindMessages
true if the any error message should be bound to this field, false to use unbound Messages

Default:
true

minValue

public abstract java.lang.String minValue
minimum allowed value, ex: "100.1". Se to the empty String for no min value. Default 0.

Default:
"0"

maxValue

public abstract java.lang.String maxValue
maximum allowed value, ex: "200.1"

Default:
""

excludeMin

public abstract boolean excludeMin
true to exclude the minimum in the valid interval, default false

Default:
false

excludeMax

public abstract boolean excludeMax
true to exclude the maximum in the valid interval, default false

Default:
false

scale

public abstract int scale
how many decimal digits, set to -1 to disable. Default 0.

See Also:
Column.precision()
Default:
0

precision

public abstract int precision
how many digits

See Also:
Column.scale()
Default:
-1