public class Range extends Predicate
JSONNumber falls in the required range.
This examples allows numbers between 50 and 100.
{ "name" :"Range validator",
"type" :"range",
"min" : 50,
"max" : 100
}
| Constructor and Description |
|---|
Range(String aName,
BigDecimal min,
BigDecimal max) |
Range(String aName,
Integer min,
Integer max) |
Range(String aName,
JSONObject aRule) |
public Range(String aName, BigDecimal min, BigDecimal max)
public Range(String aName, JSONObject aRule) throws ValidationException
ValidationExceptionpublic void validate(JSONValue aValue) throws ValidationException
ValidatoraValue - The JSONValue that has to be validated.ValidationException - If the validation fails.Copyright © 2012. All Rights Reserved.