8.2 ErrorReporter
We have introduced the concept (and class) of an ErrorReporter. [maybe should be renamed to be AaxlReporter.] It is responsible for associating messages in the form of markers with a resource and keep track of the number of messages being associated. An ErrorReporter is created for a resource. This can be an Eclipse IResource (e.g., IFile) or an EMF Resource. Since AADL models are stored as XML files, they are accessible programmatically as EMF Resources. When an ErrorReporter is created for a resource any existing AadlObjectMarkers are removed. (In case of an ErrorReporter for an IResource the AadlTextMarkers are removed).
By default an error reporter is created for AadlObjectMarkers. However, plug-in–specific markers can be introduced and an error reporter can be created for that marker type. In that case, only markers of that type are removed from the resource on creation of the error reporter.
Messages such as errors, warnings, and information can be recorded through methods provided with the ErrorReporter class. These methods reportError, reportWarning, and reportInfo take an AADL model object (of the class AObject) and a string message as parameters.
The error reporter tracks the number of errors being reported and limits them to a maximum (default 100). When the maximum is reached a message to that effect is added as marker and no further markers of the given type are added to the resource.