ModeShape Distribution 3.0.0.Beta4

org.infinispan.schematic.internal.schema
Class JsonSchemaValidatorFactory.NumericValidator

java.lang.Object
  extended by org.infinispan.schematic.internal.schema.JsonSchemaValidatorFactory.NumericValidator
All Implemented Interfaces:
Serializable, Validator
Direct Known Subclasses:
JsonSchemaValidatorFactory.ExclusiveMaximumValidator, JsonSchemaValidatorFactory.ExclusiveMinimumValidator, JsonSchemaValidatorFactory.MaximumValidator, JsonSchemaValidatorFactory.MinimumValidator
Enclosing class:
JsonSchemaValidatorFactory

protected abstract static class JsonSchemaValidatorFactory.NumericValidator
extends Object
implements Validator

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.infinispan.schematic.internal.schema.Validator
Validator.Factory, Validator.SchemaDocumentResolver
 
Constructor Summary
protected JsonSchemaValidatorFactory.NumericValidator(String propertyName, Number number)
           
 
Method Summary
protected abstract  boolean isValid(double expectedValue, double actualValue)
          Evaluate whether the actual value and expected value violate the schema rule.
protected abstract  String ruleDescription()
           
 String toString()
           
 void validate(Object fieldValue, String fieldName, Document parent, Path pathToParent, Problems problems, Validator.SchemaDocumentResolver resolver)
          Validate a portion of the supplied document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonSchemaValidatorFactory.NumericValidator

protected JsonSchemaValidatorFactory.NumericValidator(String propertyName,
                                                      Number number)
Method Detail

validate

public void validate(Object fieldValue,
                     String fieldName,
                     Document parent,
                     Path pathToParent,
                     Problems problems,
                     Validator.SchemaDocumentResolver resolver)
Description copied from interface: Validator
Validate a portion of the supplied document.

Specified by:
validate in interface Validator
Parameters:
fieldValue - the field value to be validated; may be null
fieldName - the field name to be validated; may be null if the field value is not known or the validator is to validate the document
parent - the document; never null
pathToParent - the path to the supplied document; never null but may be a zero-length path if the document is the top-level document
problems - the problems where any errors or warnings should be recorded; never null
resolver - the component that can be used to resolve references to other schema documents

isValid

protected abstract boolean isValid(double expectedValue,
                                   double actualValue)
Evaluate whether the actual value and expected value violate the schema rule.

Parameters:
expectedValue - the expected value
actualValue - the actual value
Returns:
true if the value is valid, or false if there is an error

ruleDescription

protected abstract String ruleDescription()

toString

public String toString()
Overrides:
toString in class Object

ModeShape Distribution 3.0.0.Beta4

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.