org.umber.bellows.validate
Class ValidationResult

java.lang.Object
  extended byorg.umber.bellows.validate.ValidationResult

public class ValidationResult
extends java.lang.Object

Data holder to encapsulate validation results.

Author:
jsheets

Constructor Summary
ValidationResult()
          Creates a new default instance of ValidationResult.
ValidationResult(boolean isValid, java.lang.String[] messages, Datum[] errorNodes)
          Creates a new instance of ValidationResult with the given parameters.
 
Method Summary
 Datum[] getErrorNodes()
          Retrieves the array of Datum nodes in the data tree that caused validation errors.
 java.lang.String[] getMessages()
          Retrieves the array of warning and error messages generated by the validation process.
 boolean isValid()
          Retrieves the overall success of the validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationResult

public ValidationResult()
Creates a new default instance of ValidationResult. The result is valid, with no messages or error nodes.


ValidationResult

public ValidationResult(boolean isValid,
                        java.lang.String[] messages,
                        Datum[] errorNodes)
Creates a new instance of ValidationResult with the given parameters.

Parameters:
isValid - true if the validation was successful
messages - array of text messages from the validation
errorNodes - array of Datum nodes with validation errors
Method Detail

isValid

public boolean isValid()
Retrieves the overall success of the validation.

Returns:
true if validation was successful

getMessages

public java.lang.String[] getMessages()
Retrieves the array of warning and error messages generated by the validation process.

Returns:
array of validation messages

getErrorNodes

public Datum[] getErrorNodes()
Retrieves the array of Datum nodes in the data tree that caused validation errors.

Returns:
array of error-causing data nodes