org.milyn.validation
Class ValidationResult

java.lang.Object
  extended by org.milyn.payload.FilterResult
      extended by org.milyn.validation.ValidationResult
All Implemented Interfaces:
javax.xml.transform.Result

public class ValidationResult
extends FilterResult

ValidationResult object for capturing validation failures at different levels.

Author:
Daniel Bevenius

Field Summary
 
Fields inherited from class org.milyn.payload.FilterResult
CONTEXT_KEY
 
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
 
Constructor Summary
ValidationResult()
          Public default constructor.
 
Method Summary
protected  void addResult(OnFailResult result, OnFail onFail)
          Adds the OnFailResult with OnFail level passed in.
 java.util.List<OnFailResult> getErrors()
          Gets all the OnFailResults that were reported at the OnFail.ERROR level.
 OnFailResult getFatal()
          Gets the OnFailResult that was reported as a OnFail.FATAL.
 int getNumFailures()
          Get the total number of failures on this ValidationResult instance.
 java.util.List<OnFailResult> getOKs()
          Gets all the OnFailResults that were reported at the OnFail.OK level.
 java.util.List<OnFailResult> getWarnings()
          Gets all the OnFailResults that were reported at the OnFail.WARN level.
 java.lang.String toString()
           
 
Methods inherited from class org.milyn.payload.FilterResult
getResult, getResults, getSystemId, setResults, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationResult

public ValidationResult()
Public default constructor.

Method Detail

getOKs

public java.util.List<OnFailResult> getOKs()
Gets all the OnFailResults that were reported at the OnFail.OK level.

Returns:
List OnFailResult reported at OnFail.OK.

getWarnings

public java.util.List<OnFailResult> getWarnings()
Gets all the OnFailResults that were reported at the OnFail.WARN level.

Returns:
List of OnFailResult reported at OnFail.WARN.

getErrors

public java.util.List<OnFailResult> getErrors()
Gets all the OnFailResults that were reported at the OnFail.ERROR level.

Returns:
List of OnFailResult reported at OnFail.ERROR.

getFatal

public OnFailResult getFatal()
Gets the OnFailResult that was reported as a OnFail.FATAL.

Can only be one OnFail.FATAL.

Returns:
OnFail.FATAL OnFailResult if one occured, otherwise null.

getNumFailures

public int getNumFailures()
Get the total number of failures on this ValidationResult instance.

Returns:
The total number of failures on this ValidationResult instance.

addResult

protected void addResult(OnFailResult result,
                         OnFail onFail)
Adds the OnFailResult with OnFail level passed in.

Parameters:
result - The OnFailResult. Cannot be null.
onFail - The OnFail level for which this rule should be reported.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.