org.codehaus.enunciate.contract.validation
Class ValidationResult

java.lang.Object
  extended by org.codehaus.enunciate.contract.validation.ValidationResult

public class ValidationResult
extends java.lang.Object

The result of validation.

Author:
Ryan Heaton

Constructor Summary
ValidationResult()
           
 
Method Summary
 void addError(com.sun.mirror.declaration.Declaration declaration, java.lang.String text)
          Add an error message.
 void addError(com.sun.mirror.util.SourcePosition position, java.lang.String text)
          Add an error message.
 void addWarning(com.sun.mirror.declaration.Declaration declaration, java.lang.String text)
          Add n warning message.
 void addWarning(com.sun.mirror.util.SourcePosition position, java.lang.String text)
          Add an warning message.
 void aggregate(java.lang.String label, ValidationResult result)
          Aggregate the specified result to these results.
 void aggregate(ValidationResult result)
          Aggregate the specified result to these results.
protected  java.lang.String appendReferenceInformation(java.lang.String text, java.util.Set<java.lang.String> referencedFrom)
           
 java.util.List<ValidationMessage> getErrors()
          The errors.
 java.lang.String getLabel()
          The label that has been applied.
 java.util.List<ValidationMessage> getWarnings()
          Whether there are any warnings in the result.
 boolean hasErrors()
          Whether there are any errors in the result.
 boolean hasWarnings()
          Whether there are any warnings in the result.
 void setLabel(java.lang.String label)
          Apply a specific label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationResult

public ValidationResult()
Method Detail

getLabel

public java.lang.String getLabel()
The label that has been applied.

Returns:
The label that has been applied.

setLabel

public void setLabel(java.lang.String label)
Apply a specific label.

Parameters:
label - The label to apply.

hasErrors

public boolean hasErrors()
Whether there are any errors in the result.

Returns:
Whether there are any errors in the result.

addError

public void addError(com.sun.mirror.util.SourcePosition position,
                     java.lang.String text)
Add an error message.

Parameters:
position - The source position.
text - The text of the error message.

addError

public void addError(com.sun.mirror.declaration.Declaration declaration,
                     java.lang.String text)
Add an error message.

Parameters:
declaration - The position of the error.
text - The text of the error message.

appendReferenceInformation

protected java.lang.String appendReferenceInformation(java.lang.String text,
                                                      java.util.Set<java.lang.String> referencedFrom)

getErrors

public java.util.List<ValidationMessage> getErrors()
The errors.

Returns:
The errors.

hasWarnings

public boolean hasWarnings()
Whether there are any warnings in the result.

Returns:
Whether there are any warnings in the result.

addWarning

public void addWarning(com.sun.mirror.util.SourcePosition position,
                       java.lang.String text)
Add an warning message.

Parameters:
position - The source position.
text - The text of the warning message.

addWarning

public void addWarning(com.sun.mirror.declaration.Declaration declaration,
                       java.lang.String text)
Add n warning message.

Parameters:
declaration - The position of the warning.
text - The text of the warning message.

getWarnings

public java.util.List<ValidationMessage> getWarnings()
Whether there are any warnings in the result.

Returns:
Whether there are any warnings in the result.

aggregate

public void aggregate(ValidationResult result)
Aggregate the specified result to these results.

Parameters:
result - The result to aggregate.

aggregate

public void aggregate(java.lang.String label,
                      ValidationResult result)
Aggregate the specified result to these results.

Parameters:
label - The label to be applied to the aggregated messages.
result - The result to aggregate.