Class BaseJsonValidator
java.lang.Object
com.inductiveautomation.ignition.common.jsonschema.BaseJsonValidator
- All Implemented Interfaces:
JsonValidator
- Direct Known Subclasses:
AdditionalPropertiesValidator
,AllOfValidator
,AnyOfValidator
,ConstValidator
,ContainsValidator
,DependenciesValidator
,DynamicSuggestionsValidator
,EnumValidator
,ExtensionValidator
,FormatValidator
,ItemsValidator
,JsonSchema
,MaximumValidator
,MaxItemsValidator
,MaxLengthValidator
,MaxPropertiesValidator
,MinimumValidator
,MinItemsValidator
,MinLengthValidator
,MinPropertiesValidator
,MultipleOfValidator
,NotValidator
,OneOfValidator
,PatternPropertiesValidator
,PatternValidator
,PropertiesValidator
,PropertyNamesValidator
,RefValidator
,RequiredValidator
,SuggestionsValidator
,TypeValidator
,UniqueItemsValidator
,VisibleWhenValidator
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.common.jsonschema.JsonValidator
AT_ROOT
-
Constructor Summary
ConstructorsConstructorDescriptionBaseJsonValidator
(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType) BaseJsonValidator
(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, boolean useRefCache) BaseJsonValidator
(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, JsonSchema subSchema) BaseJsonValidator
(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, JsonSchema subSchema, boolean useRefCache) -
Method Summary
Modifier and TypeMethodDescriptionint
asInt
(com.inductiveautomation.ignition.common.gson.JsonElement element) protected ValidationMessage
buildValidationMessage
(String at, String... arguments) protected void
debug
(org.slf4j.Logger logger, com.inductiveautomation.ignition.common.gson.JsonElement node, com.inductiveautomation.ignition.common.gson.JsonElement rootNode, String at) protected boolean
equals
(double n1, double n2) protected JsonSchema
protected com.inductiveautomation.ignition.common.gson.JsonElement
protected String
protected JsonSchema
protected ValidatorTypeCode
protected boolean
greaterThan
(double n1, double n2) protected boolean
protected boolean
lessThan
(double n1, double n2) protected JsonSchema
obtainSubSchemaNode
(com.inductiveautomation.ignition.common.gson.JsonElement schemaNode) protected void
parseErrorCode
(String errorCodeKey) protected boolean
validate
(com.inductiveautomation.ignition.common.gson.JsonElement node) Validate the given root JsonElement, starting at the root of the data path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.common.jsonschema.JsonValidator
validate
-
Constructor Details
-
BaseJsonValidator
public BaseJsonValidator(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType) -
BaseJsonValidator
public BaseJsonValidator(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, JsonSchema subSchema, boolean useRefCache) -
BaseJsonValidator
public BaseJsonValidator(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, JsonSchema subSchema) -
BaseJsonValidator
public BaseJsonValidator(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, boolean useRefCache)
-
-
Method Details
-
getSchemaPath
-
getSchemaNode
protected com.inductiveautomation.ignition.common.gson.JsonElement getSchemaNode() -
getParentSchema
-
getSubSchema
-
hasSubSchema
protected boolean hasSubSchema() -
useRefCache
protected boolean useRefCache() -
obtainSubSchemaNode
protected JsonSchema obtainSubSchemaNode(com.inductiveautomation.ignition.common.gson.JsonElement schemaNode) -
validate
public Set<ValidationMessage> validate(com.inductiveautomation.ignition.common.gson.JsonElement node) Description copied from interface:JsonValidator
Validate the given root JsonElement, starting at the root of the data path.- Specified by:
validate
in interfaceJsonValidator
- Parameters:
node
- JsonElement- Returns:
- A list of ValidationMessage if there is any validation error, or an empty list if there is no error.
-
equals
protected boolean equals(double n1, double n2) -
greaterThan
protected boolean greaterThan(double n1, double n2) -
lessThan
protected boolean lessThan(double n1, double n2) -
parseErrorCode
-
buildValidationMessage
-
debug
protected void debug(org.slf4j.Logger logger, com.inductiveautomation.ignition.common.gson.JsonElement node, com.inductiveautomation.ignition.common.gson.JsonElement rootNode, String at) -
getValidatorType
-
asInt
public int asInt(com.inductiveautomation.ignition.common.gson.JsonElement element)
-