public class Switch extends Predicate
{
"name" :"Switch test",
"type" :"switch",
"key":"discriminator",
"case" : [{"values":["a", "b", "c", 1, 2, 3], "rule":{"type":"true"}}]
}
Modifier and Type | Class and Description |
---|---|
static class |
Switch.SwitchCase |
Constructor and Description |
---|
Switch(String aName,
JSONObject aRule,
HashMap<String,Validator> aRuleset) |
Switch(String aName,
String discriminator,
HashMap<String,Validator> aRuleset,
Switch.SwitchCase... cases) |
public Switch(String aName, String discriminator, HashMap<String,Validator> aRuleset, Switch.SwitchCase... cases)
public Switch(String aName, JSONObject aRule, HashMap<String,Validator> aRuleset) throws ValidationException
ValidationException
public void validate(JSONValue aValue) throws ValidationException
Validator
aValue
- The JSONValue that has to be validated.ValidationException
- If the validation fails.Copyright © 2012. All Rights Reserved.