public class FalseSchema extends Object implements SchemaInternal
Constructor and Description |
---|
FalseSchema(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. |
Object |
getDefaultValue()
Return the default value defined in the schema
|
static FalseSchema |
getInstance() |
Boolean |
getJson()
Get Json representation of the schema
|
ValidatorPriority |
getPriority()
Returns the priority
|
JsonPointer |
getScope()
Get scope of this schema
|
boolean |
hasDefaultValue()
Return true if the schema has a default value defined
|
boolean |
isSync()
Returns true if this validator can actually provide a synchronous validation
|
Future<Void> |
validateAsync(Object in)
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 in)
Validate the json performing a synchronous validation.
|
void |
validateSync(ValidatorContext context,
Object in)
Validate the provided value
|
public FalseSchema(MutableStateValidator parent)
public static FalseSchema getInstance()
public boolean isSync()
Schema
public ValidatorPriority getPriority()
PriorityGetter
getPriority
in interface PriorityGetter
public void validateSync(Object in) throws ValidationException, NoSyncValidationException
Schema
ValidationException
if json doesn't match the schema.validateSync
in interface Schema
ValidationException
NoSyncValidationException
- If the schema cannot perform a synchronous validationpublic Future<Void> validateAsync(Object in)
Schema
ValidationException
if json doesn't match the schema.
Note: If the schema is synchronous, this method will call internally this#validateSync(Object)
validateAsync
in interface Schema
public Future<Void> validateAsync(ValidatorContext context, Object in)
AsyncValidator
ValidationException
when validation failsvalidateAsync
in interface AsyncValidator
public void validateSync(ValidatorContext context, Object in) throws ValidationException, NoSyncValidationException
SyncValidator
validateSync
in interface SyncValidator
ValidationException
- if the object is not validNoSyncValidationException
- if no sync validation can be providedpublic JsonPointer getScope()
Schema
public Boolean getJson()
Schema
public Object getDefaultValue()
Schema
getDefaultValue
in interface Schema
public boolean hasDefaultValue()
Schema
hasDefaultValue
in interface Schema
public void applyDefaultValues(JsonArray array) throws NoSyncValidationException
Schema
array
applying default values, when available.applyDefaultValues
in interface Schema
NoSyncValidationException
- if this schema represents a $ref
not solved yetpublic void applyDefaultValues(JsonObject object) throws NoSyncValidationException
Schema
object
applying default values, when available.applyDefaultValues
in interface Schema
NoSyncValidationException
- if this schema represents a $ref
not solved yetCopyright © 2020 Eclipse. All rights reserved.