com.sdicons.json.validator
Class JSONValidator
java.lang.Object
com.sdicons.json.validator.JSONValidator
- All Implemented Interfaces:
- Validator
public class JSONValidator
- extends Object
- implements Validator
A validator that accepts a validator description in JSON format.
Method Summary |
void |
validate(JSONValue aValue)
Validate a JSON value according to the rules described in the
validator rules. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSONValidator
public JSONValidator(JSONObject aValidation)
throws ValidationException
- Construct the validator based on the JSON description.
- Parameters:
aValidation
- The JSON description of the validator.
- Throws:
ValidationException
- If the JSON description did not represent a validator.
validate
public void validate(JSONValue aValue)
throws ValidationException
- Validate a JSON value according to the rules described in the
validator rules.
- Specified by:
validate
in interface Validator
- Parameters:
aValue
-
- Throws:
ValidationException
Copyright © 2011. All Rights Reserved.