class JsonSchemaValidator implements SchemaValidator {

    @Override
    public SchemaValidationResults validate(String rule) {
        try {
            JSONObject jsonRule = new JSONObject(rule);
            SchemaLoader.load(schema).validate(jsonRule);
            return SchemaValidationResults.success();
        } catch (ValidationException e) {
            return mapAsSchemaValidationResults(e);
        } catch (Exception e) {
            return mapAsSchemaValidationResults(e);
        }
    }

}