com.sage.accpac.sm
Interface Errors

All Superinterfaces:
java.lang.Iterable<Error>
All Known Implementing Classes:
ErrorsImpl

public interface Errors
extends java.lang.Iterable<Error>

Provides access to the errors raised within the context of the current program. They include errors when calling methods of the Program object, as well as methods of all objects created directly or indirectly from the Program object. These include errors of all views created within the program.
An object of this class cannot be created directly by an application. Obtain the object from the Program object's Errors property.
The collection is a dynamic object; its properties can change; they reflect the state of the error stack at the time that the collection is accessed. For example consider:

 Program s;
 .
 .
 .
 View v = s.openView(...);
 .
 .
 .
 Errors e = s.getErrors();
 System.out.println(e.getCount();
 v.update();
 System.out.println(e.getCount();
 .
 .
 .
 
The count printed may be different on the second occasion due to errors caused by the update() call. Note that there is only one call to getErrors().

See Also:
Program.getErrors()

Method Summary
 void clear()
          Clears all error messages stored in the program.
 Error get(int i)
          Gets an Error object that stores details of an error.
 int getCount()
          Gets the number of errors currently stored in the program.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

clear

void clear()
Clears all error messages stored in the program.


get

Error get(int i)
Gets an Error object that stores details of an error. The error is identified by its zero-based index in the collection.

Parameters:
i - The zero-based index of the error to be returned.
Returns:
A new error object containing the details of this error. The error object returned is a freshly allocated object containing the error details at this point in time. Accessing this object significantly later will still give the details of an old error. It will not give the details of the i'th error at that time.

getCount

int getCount()
Gets the number of errors currently stored in the program. You may want to consider iterating over the collection rather than using this method.

Returns:
The count
See Also:
get(int)


Copyright © 2011 Sage Software, Inc. All rights reserved.