|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sei.osate.ui.actions.AbstractAnalysis
public abstract class AbstractAnalysis
Provides common functionality for all analyses. Provides an error manager and ensures that the public methods are called in the correct order.
Constructor Summary | |
---|---|
AbstractAnalysis()
|
Method Summary | |
---|---|
protected java.lang.String |
getConfiguratorValue(java.lang.String key)
|
protected AnalysisErrorReporterManager |
getErrorManager()
Returns an error manager that should be used by the analysis. |
protected java.lang.String |
getMarkerType()
|
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. |
protected AObject |
getParameter()
|
protected void |
propertyDefinitionNotFound(java.lang.String propertySet,
java.lang.String propertyDefinition)
Sets the notReadyToRunReason to the message that the
specified PropertyDefinition could not be found. |
boolean |
readyToRun()
For all analyses, this method ensures that the parameter still exists. |
protected abstract boolean |
readyToRunImpl()
readyToRun() will call this method. |
boolean |
run()
Execute the analysis based on the parameter. |
protected abstract boolean |
runImpl()
run() will call this method. |
void |
setConfiguratorKeysAndValues(java.util.HashMap<java.lang.String,java.lang.String> keysAndValues)
|
protected void |
setNotReadyToRunReason(java.lang.String reason)
If readyToRunImpl() determines that the analysis cannot
run, the reason should be reported to this method. |
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. |
protected void |
unitLiteralNotFound(java.lang.String unitLiteral,
UnitsType unitsType)
Sets the notReadyToRunReason to the message that the
specified UnitLiteral could not be found. |
protected void |
unitsTypeNotFound(java.lang.String propertySet,
java.lang.String unitsType)
Sets the notReadyToRunReason to the message that the
specified UnitsType could not be found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAnalysis()
Method Detail |
---|
public final void setParameter(org.eclipse.emf.common.util.URI parameterPath, java.lang.String readablePath)
IAnalysis
ComponentImpl
, SystemImpl
, or other
AObject
that the analysis runs on. The appropriate
parameter is dependent on the specific
edu.cmu.sei.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.
setParameter
in interface IAnalysis
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.public final void setConfiguratorKeysAndValues(java.util.HashMap<java.lang.String,java.lang.String> keysAndValues)
setConfiguratorKeysAndValues
in interface IAnalysis
public final boolean readyToRun()
IAnalysis
String
and can be retrieved through getNotReadyToRunReason()
.
readyToRun
in interface IAnalysis
true
if the run()
method can be
called; false
if it cannot.public final java.lang.String getNotReadyToRunReason()
IAnalysis
run()
method could not be called,
the reason is given as a human readable String
that can be
displayed to the user.
getNotReadyToRunReason
in interface IAnalysis
run()
could not be called.public final boolean run()
IAnalysis
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.
run
in interface IAnalysis
true
if the analysis passed; false
if
it failed.protected java.lang.String getMarkerType()
protected final AnalysisErrorReporterManager getErrorManager()
run()
method before it calls
runImpl()
.
protected final void setNotReadyToRunReason(java.lang.String reason)
readyToRunImpl()
determines that the analysis cannot
run, the reason should be reported to this method.
reason
- A human readable description of why the analysis cannot
run.protected final AObject getParameter()
protected final java.lang.String getConfiguratorValue(java.lang.String key)
protected final void propertyDefinitionNotFound(java.lang.String propertySet, java.lang.String propertyDefinition)
notReadyToRunReason
to the message that the
specified PropertyDefinition
could not be found.
propertySet
- PropertySet
that the
PropertyDefinition
was expected to be
in.propertyDefinition
- PropertyDefinition
that could not
be found.protected final void unitsTypeNotFound(java.lang.String propertySet, java.lang.String unitsType)
notReadyToRunReason
to the message that the
specified UnitsType
could not be found.
propertySet
- PropertySet
that the
UnitsType
was expected to be in.unitsType
- UnitsType
that could not be found.protected final void unitLiteralNotFound(java.lang.String unitLiteral, UnitsType unitsType)
notReadyToRunReason
to the message that the
specified UnitLiteral
could not be found.
unitLiteral
- UnitLiteral
that could not be found.unitsType
- UnitsType
that the
UnitLiteral
was expected to be in.protected abstract boolean readyToRunImpl()
readyToRun()
will call this method. All the checks to
ensure that readyToRun()
is called in the correct order are
handled by readyToRun()
. readyToRunImpl()
is
only called in the appropriate state. In other words, don't worry about
checking the state when overriding readyToRunImpl()
. The
return value of readyToRunImpl()
will be the return value
of readyToRun()
.
true
if the run()
method can be
called; false
if it cannot.protected abstract boolean runImpl()
run()
will call this method. All the checks to ensure that
run()
is called in the correct order are handled by
run()
. runImpl()
is only called in the
appropriate state. In other words, don't worry about checking the state
when overriding runImpl()
. The return value of
runImpl()
will be the return value of run()
.
true
if the analysis passed; false
if
it failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |