Package com.networknt.schema.keyword
Class MultipleOfValidator
- java.lang.Object
-
- com.networknt.schema.keyword.AbstractKeywordValidator
-
- com.networknt.schema.keyword.BaseKeywordValidator
-
- com.networknt.schema.keyword.MultipleOfValidator
-
- All Implemented Interfaces:
KeywordValidator,Validator,Walker
public class MultipleOfValidator extends BaseKeywordValidator implements KeywordValidator
KeywordValidatorfor multipleOf.
-
-
Field Summary
-
Fields inherited from class com.networknt.schema.keyword.BaseKeywordValidator
errorMessage, parentSchema, schemaContext
-
Fields inherited from class com.networknt.schema.keyword.AbstractKeywordValidator
schemaLocation, schemaNode
-
-
Constructor Summary
Constructors Constructor Description MultipleOfValidator(SchemaLocation schemaLocation, com.fasterxml.jackson.databind.JsonNode schemaNode, Schema parentSchema, SchemaContext schemaContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BigDecimalgetDividend(com.fasterxml.jackson.databind.JsonNode node)Gets the dividend to use.protected BigDecimalgetDivisor(com.fasterxml.jackson.databind.JsonNode schemaNode)Gets the divisor to use.voidvalidate(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, NodePath instanceLocation)Validate the instance node which belongs to the instance document at the instance location.-
Methods inherited from class com.networknt.schema.keyword.BaseKeywordValidator
error, getNodeFieldType, getParentSchema, preloadSchemas
-
Methods inherited from class com.networknt.schema.keyword.AbstractKeywordValidator
collectAnnotations, collectAnnotations, getKeyword, getSchemaLocation, getSchemaNode, hasAdjacentKeywordInEvaluationPath, hasUnevaluatedItemsInEvaluationPath, hasUnevaluatedPropertiesInEvaluationPath, putAnnotation, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.networknt.schema.keyword.KeywordValidator
getKeyword, preloadSchema
-
Methods inherited from interface com.networknt.schema.Validator
getSchemaLocation, walk
-
-
-
-
Constructor Detail
-
MultipleOfValidator
public MultipleOfValidator(SchemaLocation schemaLocation, com.fasterxml.jackson.databind.JsonNode schemaNode, Schema parentSchema, SchemaContext schemaContext)
-
-
Method Detail
-
validate
public void validate(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, NodePath instanceLocation)
Description copied from interface:ValidatorValidate the instance node which belongs to the instance document at the instance location.
-
getDivisor
protected BigDecimal getDivisor(com.fasterxml.jackson.databind.JsonNode schemaNode)
Gets the divisor to use.- Parameters:
schemaNode- the schema node- Returns:
- the divisor or null if the input is not correct
-
getDividend
protected BigDecimal getDividend(com.fasterxml.jackson.databind.JsonNode node)
Gets the dividend to use.- Parameters:
node- the node- Returns:
- the dividend or null if the type is incorrect
-
-