Package com.totvs.tjf.core.json
Class JsonSchemaValidationService
- java.lang.Object
-
- com.totvs.tjf.core.json.JsonSchemaValidationService
-
@Service public class JsonSchemaValidationService extends Object
This class provides a validation service using JSON Schemas.- Author:
- roger
-
-
Constructor Summary
Constructors Constructor Description JsonSchemaValidationService(org.springframework.core.io.ResourceLoader resourceLoader)Default constructor of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists(String key)This method verifies if the JSON Schema is available.voidvalidate(TOTVSMessage<?> message, String key)Validates a TOTVSMessage against a JSON Schemavoidvalidate(String json, String key)Validates a JSON against a JSON Schema
-
-
-
Method Detail
-
exists
public boolean exists(String key)
This method verifies if the JSON Schema is available.- Parameters:
key- the JSON Schema name- Returns:
- true if the JSON Schema exists, or false if not
-
validate
public void validate(TOTVSMessage<?> message, String key)
Validates a TOTVSMessage against a JSON Schema- Parameters:
message- the TOTVSMessage to be validatedkey- the JSON Schema name
-
-