com.arsdigita.util.parameter
Class ErrorList

java.lang.Object
  extended bycom.arsdigita.util.parameter.ErrorList

public final class ErrorList
extends Object

Subject to change. A collection to store ParameterErrors that are encountered during parameter reading or validation. This collection is used in the lifecycle methods of Parameter. It is ordinarily returned to the parameter-using code so that it can handle errors.

Version:
$Id: //core-platform/dev/src/com/arsdigita/util/parameter/ErrorList.java#5 $
Author:
Justin Ross <jross@redhat.com>
See Also:
ParameterError, Parameter

Field Summary
static String versionId
           
 
Constructor Summary
ErrorList()
          Constructs a new error list.
 
Method Summary
 void add(ParameterError error)
          Adds error to the error list.
 void check()
          Throws a ParameterException containing the error list.
 boolean isEmpty()
          Tells whether the error collection is empty or not.
 Iterator iterator()
          Gets an iterator over the currently stored errors.
 void report(Writer out)
          Prints parameter errors to out with formatting appropriate to the console.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

ErrorList

public ErrorList()
Constructs a new error list.

Method Detail

add

public final void add(ParameterError error)
Adds error to the error list.

Parameters:
error - A ParameterError representing a read or validation error; it cannot be null

iterator

public final Iterator iterator()
Gets an iterator over the currently stored errors.

Returns:
An Iterator of ParameterErrors; it cannot be null
See Also:
ParameterError

isEmpty

public final boolean isEmpty()
Tells whether the error collection is empty or not.

Returns:
true if the collection is empty, otherwise false

check

public final void check()
                 throws ParameterException
Throws a ParameterException containing the error list. This method is for use when the client code wants the program to fail via an exception if there are errors.

Throws:
ParameterException - if the error list is not empty

report

public final void report(Writer out)
Prints parameter errors to out with formatting appropriate to the console.

Parameters:
out - The Writer to print the errors to


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC