public class SchemaImpl extends BaseMutableStateValidator implements SchemaInternal
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
shouldRecordContext |
| Constructor and Description |
|---|
SchemaImpl(JsonObject schema,
JsonPointer scope,
MutableStateValidator parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyDefaultValues(JsonArray array)
This function mutates
array applying default values, when available. |
void |
applyDefaultValues(JsonObject object)
This function mutates
object applying default values, when available. |
boolean |
calculateIsSync() |
void |
doApplyDefaultValues(Object obj) |
protected ValidatorContext |
generateValidationContext(ValidatorContext parent) |
Object |
getDefaultValue()
Return the default value defined in the schema
|
JsonObject |
getJson()
Get Json representation of the schema
|
JsonPointer |
getScope()
Get scope of this schema
|
boolean |
hasDefaultValue()
Return true if the schema has a default value defined
|
protected Future<Void> |
runAsyncValidators(ValidatorContext context,
Object in) |
protected void |
runSyncValidator(ValidatorContext context,
Object in) |
void |
triggerUpdateIsSync()
Manually trigger the sync state update
|
Future<Void> |
validateAsync(Object json)
Validate the json performing an asynchronous validation.
|
Future<Void> |
validateAsync(ValidatorContext context,
Object in)
Return a Future that succeed when the validation succeed, while fail with a
ValidationException when validation fails |
void |
validateSync(Object json)
Validate the json performing a synchronous validation.
|
void |
validateSync(ValidatorContext context,
Object in)
Validate the provided value
|
checkSync, getParent, getPriority, initializeIsSync, isSync, validateSyncAsAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPrioritypublic SchemaImpl(JsonObject schema, JsonPointer scope, MutableStateValidator parent)
public Future<Void> validateAsync(Object json)
SchemaValidationException if json doesn't match the schema.
Note: If the schema is synchronous, this method will call internally this#validateSync(Object)
validateAsync in interface Schemapublic void validateSync(Object json) throws ValidationException, NoSyncValidationException
SchemaValidationException if json doesn't match the schema.validateSync in interface SchemaValidationExceptionNoSyncValidationException - If the schema cannot perform a synchronous validationpublic JsonPointer getScope()
Schemapublic JsonObject getJson()
Schemapublic Object getDefaultValue()
SchemagetDefaultValue in interface Schemapublic boolean hasDefaultValue()
SchemahasDefaultValue in interface Schemapublic void applyDefaultValues(JsonArray array) throws NoSyncValidationException
Schemaarray applying default values, when available.applyDefaultValues in interface SchemaNoSyncValidationException - if this schema represents a $ref not solved yetpublic void applyDefaultValues(JsonObject object) throws NoSyncValidationException
Schemaobject applying default values, when available.applyDefaultValues in interface SchemaNoSyncValidationException - if this schema represents a $ref not solved yetpublic void doApplyDefaultValues(Object obj)
public void triggerUpdateIsSync()
MutableStateValidatortriggerUpdateIsSync in interface MutableStateValidatortriggerUpdateIsSync in class BaseMutableStateValidatorpublic Future<Void> validateAsync(ValidatorContext context, Object in)
AsyncValidatorValidationException when validation failsvalidateAsync in interface AsyncValidatorpublic void validateSync(ValidatorContext context, Object in) throws ValidationException, NoSyncValidationException
SyncValidatorvalidateSync in interface SyncValidatorValidationException - if the object is not validNoSyncValidationException - if no sync validation can be providedpublic boolean calculateIsSync()
calculateIsSync in class BaseMutableStateValidatorprotected ValidatorContext generateValidationContext(ValidatorContext parent)
protected Future<Void> runAsyncValidators(ValidatorContext context, Object in)
protected void runSyncValidator(ValidatorContext context, Object in)
Copyright © 2021 Eclipse. All rights reserved.