public abstract class NumericValidator extends AbstractKeywordValidator
This class' role is to switch between two different validation methods:
validateLong(ProcessingReport, FullData) if both the keyword value
and instance fit exactly into a long (for performance reasons),
validateDecimal(ProcessingReport, FullData) otherwise (for accuracy
reasons).
| Modifier and Type | Field and Description |
|---|---|
protected com.fasterxml.jackson.databind.JsonNode |
number
The keyword value
|
keyword| Modifier | Constructor and Description |
|---|---|
protected |
NumericValidator(String keyword,
com.fasterxml.jackson.databind.JsonNode digest) |
| Modifier and Type | Method and Description |
|---|---|
String |
toString() |
void |
validate(com.github.fge.jsonschema.processing.Processor<FullData,FullData> processor,
com.github.fge.jsonschema.report.ProcessingReport report,
FullData data)
Validate the instance
|
protected abstract void |
validateDecimal(com.github.fge.jsonschema.report.ProcessingReport report,
FullData data)
Method to be implemented by a numeric validator if either of the
keyword value or instance value do not fit into a
long |
protected abstract void |
validateLong(com.github.fge.jsonschema.report.ProcessingReport report,
FullData data)
Method to be implemented by a numeric validator if both the keyword
value and instance value fit into a
long |
newMsgprotected final com.fasterxml.jackson.databind.JsonNode number
protected NumericValidator(String keyword, com.fasterxml.jackson.databind.JsonNode digest)
public final void validate(com.github.fge.jsonschema.processing.Processor<FullData,FullData> processor, com.github.fge.jsonschema.report.ProcessingReport report, FullData data) throws com.github.fge.jsonschema.exceptions.ProcessingException
KeywordValidatorprocessor - the main validation processorreport - the report to usedata - the validation dataInvalidInstanceException - instance is invalid, and the report has
been configured to throw an exception instead of logging errorscom.github.fge.jsonschema.exceptions.ProcessingExceptionprotected abstract void validateLong(com.github.fge.jsonschema.report.ProcessingReport report,
FullData data)
throws com.github.fge.jsonschema.exceptions.ProcessingException
longreport - the validation reportdata - the validation datacom.github.fge.jsonschema.exceptions.ProcessingExceptionprotected abstract void validateDecimal(com.github.fge.jsonschema.report.ProcessingReport report,
FullData data)
throws com.github.fge.jsonschema.exceptions.ProcessingException
longreport - the validation reportdata - the validation datacom.github.fge.jsonschema.exceptions.ProcessingExceptionpublic final String toString()
toString in class AbstractKeywordValidatorCopyright © 2014. All Rights Reserved.