public interface IAnalysis
IAnalysis
is the interface for all analyses that can be run
through the Auto-Analysis view. There should be one analysis instance per
analysis run. Here is the life cycle of an IAnalysis
object:
1. Create a new instance.
2. Call setParameter(AObject parameter)
.
3. Call readyToRun()
.
4a. If readyToRun()
returned true
, call run()
.
4b. If readyToRun()
returned false
, call getNotReadyToRunReason()
.
If a method is called out of order, an IllegalStateException
is
thrown. After step 4 is executed, the object is dead and should no longer
be used. Do not try to reset the parameter or run the analysis again.
Instead, a new IAnalysis
object should be created.Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNotReadyToRunReason()
If for some reason the
run() method could not be called,
the reason is given as a human readable String that can be
displayed to the user. |
boolean |
readyToRun()
For all analyses, this method ensures that the parameter still exists.
|
boolean |
run()
Execute the analysis based on the parameter.
|
void |
setConfiguratorKeysAndValues(java.util.HashMap<java.lang.String,java.lang.String> keysAndValues) |
void |
setParameter(org.eclipse.emf.common.util.URI parameterPath,
java.lang.String readablePath)
Depending on the analysis, the parameter is the model,
ComponentImpl , SystemImpl , or other
AObject that the analysis runs on. |
void setParameter(org.eclipse.emf.common.util.URI parameterPath, java.lang.String readablePath)
ComponentImpl
, SystemImpl
, or other
AObject
that the analysis runs on. The appropriate
parameter is dependent on the specific
org.osate.ui.analysis
extension.
setParameter
does not validate the parameter. It is the
responsibility of this method's caller to ensure that the parameter is
appropriate according to the analysis' plugin.xml
file.parameterPath
- The URI
path of the parameter which
can be found by calling
EcoreUtil.getURI(EObject)
.readablePath
- A textual representation of the parameter including
its location that can be displayed to the user.void setConfiguratorKeysAndValues(java.util.HashMap<java.lang.String,java.lang.String> keysAndValues)
boolean run()
true
is returned. If the analysis failed, then
false
is returned. For most analyses, failure is reported
through problem markers on the model, however this behavior is not
guaranteed for all analyses. See each analysis for failure details.true
if the analysis passed; false
if
it failed.boolean readyToRun()
String
and can be retrieved through getNotReadyToRunReason()
.true
if the run()
method can be
called; false
if it cannot.java.lang.String getNotReadyToRunReason()
run()
method could not be called,
the reason is given as a human readable String
that can be
displayed to the user.run()
could not be called.