public final class AnalysisErrorReporterManager extends AbstractErrorReporterManager
edu.cmu.sei.aadl.model.pluginsupport.AnalysisErrorReporter
instances
across a set of AADL text file resources. The manager keeps track of EMF
Resource
objects and not Eclipse
IResource
objects because the primary
purpose of this class is to provide the correct error reporter when trying to
interpret and resolve an already parsed model. So the errors are going to be
found when using Element
instances, but
the errors reported on the AADL text file. This class solves the problem of
mapping from the AObject to the text file.
It's probably redundant to have the methods take the filename as a parameter as they do, because the error reporters could already have the filename information, but the parser is already written to work that way. Also, I suppose we could have the situation where many files are used to create a single resource, in which case the filename would not be redundant.
The manager is supplied with a
edu.cmu.sei.aadl.model.pluginsupport.ParseErrorReporterFactory
instance that is used to create the error reporters.
This class purposely only depends on EMF, and not on Eclipse.
That is, while it would be convienent to make explicit use of IResources
here, we have chosen not to. Specific ParseErrorReporter
may, of
course, have whatever dependencies they like.
edu.cmu.sei.aadl.model.pluginsupport.ParseErrorReporter
,
edu.cmu.sei.aadl.model.pluginsupport.ParseErrorReporterFactory
Modifier and Type | Field and Description |
---|---|
static AnalysisErrorReporterManager |
NULL_ERROR_MANANGER
Singleton reference to an error manager that ignores all messages.
|
Constructor and Description |
---|
AnalysisErrorReporterManager(AnalysisErrorReporterFactory fact) |
AnalysisErrorReporterManager(InternalErrorReporter ier,
AnalysisErrorReporterFactory fact)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addPrefix(java.lang.String pre) |
void |
error(Element obj,
java.lang.String msg)
Report an error on an AObject (AADL object model object) using the error
reporter associated with that object's
Resource . |
void |
error(Element obj,
java.lang.String msg,
java.lang.String[] attrs,
java.lang.Object[] values) |
int |
getNumErrors()
Get the total number of errors reported across all the error reporters
being managed.
|
int |
getNumInfos()
Get the total number of errors reported across all the error reporters
being managed.
|
int |
getNumMessages()
Get the total number of errors and warnings across all the error reports
being managed.
|
int |
getNumWarnings()
Get the total number of warnings reported across all the error reporters
being managed.
|
AnalysisErrorReporter |
getReporter(org.eclipse.emf.ecore.resource.Resource rsrc)
Get the error reporter that is associated with the given
Resource . |
void |
info(Element obj,
java.lang.String msg)
Report an information message on an AObject (AADL object model object)
using the error reporter associated with that object's
Resource . |
void |
info(Element obj,
java.lang.String msg,
java.lang.String[] attrs,
java.lang.Object[] values) |
void |
removePrefix() |
void |
removeResource(org.eclipse.emf.ecore.resource.Resource rsrc)
Stop managing the given Resource.
|
void |
warning(Element obj,
java.lang.String msg)
Report a warning on an AObject (AADL object model object) using the error
reporter associated with that object's
Resource . |
void |
warning(Element obj,
java.lang.String msg,
java.lang.String[] attrs,
java.lang.Object[] values) |
getNumInternalErrors, internalError, internalError
public static final AnalysisErrorReporterManager NULL_ERROR_MANANGER
public AnalysisErrorReporterManager(AnalysisErrorReporterFactory fact)
@Deprecated public AnalysisErrorReporterManager(InternalErrorReporter ier, AnalysisErrorReporterFactory fact)
public final void removeResource(org.eclipse.emf.ecore.resource.Resource rsrc)
rsrc
- The resource to forget about.public final AnalysisErrorReporter getReporter(org.eclipse.emf.ecore.resource.Resource rsrc)
Resource
.
If the manager has not yet used the error reporter for the given
resource, the ErrorReporter.deleteMessages()
method is called on
the reporter.java.lang.IllegalArgumentException
- Thrown if a reporter cannot be found or created for the
given Resource.java.lang.NullPointerException
- Thrown if rsrc
is null
.public final int getNumErrors()
public final int getNumWarnings()
public final int getNumInfos()
public final int getNumMessages()
public final void addPrefix(java.lang.String pre)
public final void removePrefix()
public void error(Element obj, java.lang.String msg)
Resource
.obj
- the object to which the marker is pointingmsg
- the message as stringpublic void error(Element obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)
public void warning(Element obj, java.lang.String msg)
Resource
.obj
- the object to which the marker is pointingmsg
- the message as stringpublic void warning(Element obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)
public void info(Element obj, java.lang.String msg)
Resource
.obj
- the object to which the marker is pointingmsg
- the message as stringpublic void info(Element obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)