Package eu.europa.esig.json
Class JSONSchemaAbstractUtils
java.lang.Object
eu.europa.esig.json.JSONSchemaAbstractUtils
- Direct Known Subclasses:
AbstractJWSUtils,CryptographicSuiteJsonUtils
This class contains util methods for parsing and validation of JSON documents
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a JSON Draft 7 Schema definitionprotected com.github.erosb.jsonsKema.SchemaGets the schema according to the current JSON specificationGets a list of schema definitionsabstract StringGets URI for the current schemaprotected com.github.erosb.jsonsKema.ValidatorGets a validator for the given JSON schemaprotected com.github.erosb.jsonsKema.SchemaloadSchema(String schemaJSON, Map<URI, String> definitions) Loads schema with the given list of definitions (references)validateAgainstSchema(com.github.erosb.jsonsKema.JsonObject json) Validates a JSON against JWS Schema according to ETSI TS 119 322 JSON schemavalidateAgainstSchema(JsonObjectWrapper jsonObjectWrapper) Validates a JSON against JWS Schema according to ETSI TS 119 322 JSON schemaValidates a JSON against JWS Schema according to ETSI TS 119 322 JSON schemavalidateAgainstSchema(String jsonString) Validates a JSON against JWS Schema according to ETSI TS 119 322 JSON schema
-
Constructor Details
-
JSONSchemaAbstractUtils
protected JSONSchemaAbstractUtils()Empty constructor
-
-
Method Details
-
validateAgainstSchema
Validates a JSON against JWS Schema according to ETSI TS 119 322 JSON schema- Parameters:
is-InputStreamrepresenting a JSON to validate- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstSchema
Validates a JSON against JWS Schema according to ETSI TS 119 322 JSON schema -
validateAgainstSchema
Validates a JSON against JWS Schema according to ETSI TS 119 322 JSON schema- Parameters:
jsonObjectWrapper-JsonObjectWrapperrepresenting a JSON to validate- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
validateAgainstSchema
Validates a JSON against JWS Schema according to ETSI TS 119 322 JSON schema- Parameters:
json-JsonObjectrepresenting a JSON to validate- Returns:
- a list of
Stringmessages containing errors occurred during the validation process, empty list when validation succeeds
-
getSchema
protected com.github.erosb.jsonsKema.Schema getSchema()Gets the schema according to the current JSON specification- Returns:
Schema
-
getSchemaURI
Gets URI for the current schema- Returns:
String
-
getSchemaDefinitions
Gets a list of schema definitions- Returns:
- a map between schema URI's and their filesystem locations
-
getValidator
protected com.github.erosb.jsonsKema.Validator getValidator()Gets a validator for the given JSON schema- Returns:
Validator
-
getJSONSchemaDefinitions
Returns a JSON Draft 7 Schema definition- Returns:
- a map of definitions
-
loadSchema
protected com.github.erosb.jsonsKema.Schema loadSchema(String schemaJSON, Map<URI, String> definitions) Loads schema with the given list of definitions (references)- Parameters:
schemaJSON-JsonObjectthe schema object URIdefinitions- a map containing definitions and their reference names- Returns:
Schema
-