Class ObjectValidatorFactory
- java.lang.Object
-
- org.forgerock.json.schema.validator.ObjectValidatorFactory
-
public final class ObjectValidatorFactory extends Object
ObjectValidatorFactory initialises the validator instances for given schemas.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Validator
getTypeValidator(String type, Map<String,Object> schema, List<String> jsonPointer)
Instantiates a validator of the passed in type with the given schema.static Validator
getTypeValidator(Map<String,Object> schema)
Returns a validator validating the schema.static Validator
getTypeValidator(Map<String,Object> schema, List<String> jsonPointer)
Returns a validator validating the schema.
-
-
-
Method Detail
-
getTypeValidator
public static Validator getTypeValidator(Map<String,Object> schema)
Returns a validator validating the schema.- Parameters:
schema
- JSON Schema Draft-03 object- Returns:
- Pre-configured
Validator
instance. - Throws:
NullPointerException
- when theschema
is null.RuntimeException
- when the validators in theschema
is not supported.
-
getTypeValidator
public static Validator getTypeValidator(Map<String,Object> schema, List<String> jsonPointer)
Returns a validator validating the schema. It uses the passed in JSON pointer as a relative location of the validator in the schema.- Parameters:
schema
- JSON Schema Draft-03 objectjsonPointer
- the list of tokens representing the JSON pointer leading to this validator- Returns:
- Pre-configured
Validator
instance. - Throws:
NullPointerException
- when theschema
is null.RuntimeException
- when the validators in theschema
is not supported.
-
getTypeValidator
public static Validator getTypeValidator(String type, Map<String,Object> schema, List<String> jsonPointer)
Instantiates a validator of the passed in type with the given schema.- Parameters:
type
- the type of Validator to instantiateschema
- the schema that the instantiated validator will validatejsonPointer
- the list of tokens representing the JSON pointer leading to this validator- Returns:
- the instantiated validator. Cannot be null.
- Throws:
RuntimeException
- when the validators in theschema
is not supported.
-
-