org.netbeans.validation.api
Class Problems

java.lang.Object
  extended by org.netbeans.validation.api.Problems

public final class Problems
extends java.lang.Object

A collection of problems, to which a Validator can add additional problems.

Author:
Tim Boudreau

Constructor Summary
Constructor and Description
Problems()
           
 
Method Summary
Modifier and Type Method and Description
 void add(Problem problem)
          Add a problem
 void add(java.lang.String problem)
          Convenience method to add a problem with the specified message and Severity.FATAL
 void add(java.lang.String problem, Severity severity)
          Add a problem with the specified severity
 Problem getLeadProblem()
          Get the first problem of the highest severity
 boolean hasFatal()
          Determine if this set of problems includes any that are fatal.
 boolean isEmpty()
          Determine if this set of problems is empty
 void putAll(Problems problems)
          Dump all problems in another instance of Problems into this one.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Problems

public Problems()
Method Detail

add

public final void add(java.lang.String problem)
Convenience method to add a problem with the specified message and Severity.FATAL

Parameters:
problem -

add

public final void add(java.lang.String problem,
                      Severity severity)
Add a problem with the specified severity

Parameters:
problem - the message
severity - the severity

add

public final void add(Problem problem)
Add a problem

Parameters:
problem - The problem

putAll

public final void putAll(Problems problems)
Dump all problems in another instance of Problems into this one.

Parameters:
problems - The other problems.

isEmpty

public final boolean isEmpty()
Determine if this set of problems is empty

Returns:
true if there are no problems here

hasFatal

public final boolean hasFatal()
Determine if this set of problems includes any that are fatal.

Returns:
true if a fatal problem has been encountered

getLeadProblem

public final Problem getLeadProblem()
Get the first problem of the highest severity

Returns:
The most severe problem in this set

toString

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