@ComponentProfile(summary="Validate a JSON document against a schema", tag="service,json,schema,validation,metadata") public class JsonSchemaService extends ServiceImp
In the adapter configuration file this class is aliased as json-schema-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
JsonSchemaService() |
JsonSchemaService(DataInputParameter<java.lang.String> url) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage message) |
JsonSchemaLoader |
getJsonSchemaLoader()
Get the JSON schema loader
|
ValidationExceptionHandler |
getOnValidationException() |
DataInputParameter<java.lang.String> |
getSchemaUrl()
Get the URL of the schema to use for JSON validation.
|
protected void |
initService() |
void |
prepare() |
void |
setJsonSchemaLoader(JsonSchemaLoader jsonSchemaLoader)
Set the JSON schema loader
|
void |
setOnValidationException(ValidationExceptionHandler v)
Specify what to do when a schema validation is encountered.
|
void |
setSchemaUrl(DataInputParameter<java.lang.String> schemaUrl)
Set the URL of the schema to use for JSON validation.
|
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public JsonSchemaService()
public JsonSchemaService(DataInputParameter<java.lang.String> url)
public void doService(AdaptrisMessage message) throws ServiceException
ServiceException
public void prepare() throws CoreException
CoreException
protected void closeService()
closeService
in class ServiceImp
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
public void setSchemaUrl(DataInputParameter<java.lang.String> schemaUrl)
schemaUrl
- The URL of the schema to use for validation.public DataInputParameter<java.lang.String> getSchemaUrl()
public ValidationExceptionHandler getOnValidationException()
public void setOnValidationException(ValidationExceptionHandler v)
v
- public void setJsonSchemaLoader(JsonSchemaLoader jsonSchemaLoader)
jsonSchemaLoader
- the JSON schema loaderpublic JsonSchemaLoader getJsonSchemaLoader()