|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sei.aadl.model.util.ForAllAObject
public class ForAllAObject
ForAllAObject plays the role of an iterator object that supports traversal of AADL models Encapsulates traversal algorithms over models. Each instance of ForAllAObject contains a resultList that holds all visited model objects as result of the default action.
Processing of model elements is performed by the process(AObject)
method,
which by default calls suchThat(AObject)
to evaluate a condition and
then action(AObject)
to perform an
action. The default condition is true
and the default action is to add the
visited AObject to a resultList. Subclasses can either override
suchThat(edu.cmu.sei.aadl.model.core.AObject)
and or action(edu.cmu.sei.aadl.model.core.AObject)
to get the desired filtering effects,
or they can override process(edu.cmu.sei.aadl.model.core.AObject)
directly.
Traversals may append objects to a result list. The default implementation
of action(edu.cmu.sei.aadl.model.core.AObject)
simply adds the visited object to the list. Many of the
traversals return this list as their result. Analysis are not required to
do anything with this list, however. This list can also be retreived using
getResultList()
.
For ease of anonymous invocation, traversals specify a preferred or default
traversal method at construction time using one of the constants
NO_DEFAULT
, PROCESS_BOTTOM_UP_COMPONENT_IMPL
,
PROCESS_POST_ORDER_ALL
, PROCESS_PRE_ORDER_ALL
,
PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
, or
PROCESS_TOP_DOWN_COMPONENT_IMPL
. This default traversal method
is used by the defaultTraversal(AObject)
and
defaultTraversal(List)
methods. If no default is explicitly
specified, then PROCESS_PRE_ORDER_ALL
is used. If the default
traversal is NO_DEFAULT
, then the default traversal methods
will throw an UnsupportedOperationException
.
The default traversal can be run over all the declarative models in the
workspace using defaultTraversalAllDeclarativeModels()
. It can be
run over all the instance models in the workspace using
defaultTraversalAllInstances()
.
A traversal can cancel itself by calling cancelTraversal()
.
The traversal methods routinely invoke notCancelled()
to see if
the traversal has been cancelled. The end user of the traversal object
can determine if the traversal was cancelled by checking cancelled()
.
The result list is not in a well defined state when the traversal has been
cancelled.
Field Summary | |
---|---|
static java.lang.String |
copyright
|
static int |
DEFAULT_DEFAULT_TRAVERSAL
The default setting for the default traversal method. |
static int |
NO_DEFAULT
Constant indicating that there is no default traversal method. |
static int |
PROCESS_BOTTOM_UP_COMPONENT_IMPL
Constant indicating the default traversal method is processBottomUpComponentImpl(ComponentImpl) . |
static int |
PROCESS_POST_ORDER_ALL
Constant indicating the default traversal method is processPostOrderAll(AObject) . |
static int |
PROCESS_PRE_ORDER_ALL
Constant indicating the default traversal method is processPreOrderAll(AObject) . |
static int |
PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
Constant indicating the default traversal method is processTopDownComponentClassifier(ComponentImpl) . |
static int |
PROCESS_TOP_DOWN_COMPONENT_IMPL
Constant indicating the default traversal method is processTopDownComponentImpl(ComponentImpl) . |
protected org.eclipse.emf.common.util.EList |
resultList
This list is returned as the result value of the various traversal methods. |
Constructor Summary | |
---|---|
ForAllAObject()
Create a new traversal that uses the null error
mananger the
default default traversal algorithm . |
|
ForAllAObject(AnalysisErrorReporterManager errMgr)
Create a new traversal that uses the given error manager and uses the default default traversal algorithm . |
|
ForAllAObject(int defTraversal)
Create a new traversal that uses the null error
mananger and the given default traversal algorithm. |
|
ForAllAObject(int defTraversal,
AnalysisErrorReporterManager errMgr)
Create a new traversal that uses the given error manager and uses the given default traversal algorithm. |
Method Summary | |
---|---|
protected void |
action(AObject obj)
Action to be performed on the currently visited model object. |
boolean |
cancelled()
Test if we are cancelled. |
protected void |
cancelTraversal()
Mark that the traversal should be cancelled. |
org.eclipse.emf.common.util.EList |
defaultTraversal(AObject obj)
Execute the default traversal algorithm using the given root object. |
org.eclipse.emf.common.util.EList |
defaultTraversal(java.util.List objs)
Execute the default traversal algorithm using the given list of root objects. |
org.eclipse.emf.common.util.EList |
defaultTraversalAllDeclarativeModels()
Perform the default traversal on all the declarative models in the workspace. |
org.eclipse.emf.common.util.EList |
defaultTraversalAllInstances()
Perform the default traversal on all the instance models in the workspace. |
void |
error(AObject 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(AObject obj,
java.lang.String msg,
java.lang.String[] attrs,
java.lang.Object[] values)
|
AnalysisErrorReporterManager |
getErrorManager()
Get the analysis error reporter manager associated with this traversal. |
org.eclipse.emf.common.util.EList |
getResultList()
Get the result list of the traversal. |
void |
info(AObject 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(AObject obj,
java.lang.String msg,
java.lang.String[] attrs,
java.lang.Object[] values)
|
void |
internalError(java.lang.Exception e)
Report an internal error. |
void |
internalError(java.lang.String message)
Report an internal error. |
boolean |
notCancelled()
Test if we weren't cancelled. |
protected void |
process(AObject theAObject)
Process a single model object. |
org.eclipse.emf.common.util.EList |
processAllComponentImpl()
Visits all component implementations in the workspace. |
org.eclipse.emf.common.util.EList |
processBottomUpComponentImpl()
Visits all the component implementations in the workspace in reverse containment order. |
org.eclipse.emf.common.util.EList |
processBottomUpComponentImpl(ComponentImpl root)
Visits all the component implementations in the subtree rooted at the given node in reverse containment order. |
org.eclipse.emf.common.util.EList |
processEList(org.eclipse.emf.common.util.EList list)
Processes a list of AObjects by invoking process(AObject) on
every element of the list in order. |
void |
processObject(AObject theAObject)
Process a single model object. |
org.eclipse.emf.common.util.EList |
processPostOrderAll()
Process all AADL models in the AadlWorkspace in postfix order. |
org.eclipse.emf.common.util.EList |
processPostOrderAll(AObject obj)
Does postorder processing of the model starting at the given node. |
org.eclipse.emf.common.util.EList |
processPostOrderAll(org.eclipse.emf.common.util.EList objlist)
Does postorder processing of the model starting at the given root nodes. |
org.eclipse.emf.common.util.EList |
processPostOrderAllDeclarativeModels()
Process all declarative AADL models in the AadlWorkspace in postfix order. |
org.eclipse.emf.common.util.EList |
processPostOrderAllInstances()
Process all AADL instance models in the AadlWorkspace in postfix order. |
org.eclipse.emf.common.util.EList |
processPostOrderComponentInstance(ComponentInstance obj)
Visits all the ComponentInstance objects in the given instance
model in post fix order. |
org.eclipse.emf.common.util.EList |
processPostOrderComponentInstance(ComponentInstance obj,
ComponentCategory cat)
Visits all the ComponentInstance objects that are of the given
component category (e.g., system, data, thread, etc.) in the given
instance model in post fix order. |
org.eclipse.emf.common.util.EList |
processPreOrderAll()
Process all AADL models in the AadlWorkspace in in prefix order. |
org.eclipse.emf.common.util.EList |
processPreOrderAll(AObject obj)
Does preorder processing of the model starting at the given node. |
org.eclipse.emf.common.util.EList |
processPreOrderAll(org.eclipse.emf.common.util.EList objlist)
Does preorder processing of the model starting at the given root nodes. |
org.eclipse.emf.common.util.EList |
processPreOrderAllDeclarativeModels()
Process all declarative AADL models in the AadlWorkspace in prefix order. |
org.eclipse.emf.common.util.EList |
processPreOrderAllInstances()
Process all AADL instance models in the AadlWorkspace in prefix order. |
org.eclipse.emf.common.util.EList |
processPreOrderComponentInstance(ComponentInstance obj)
Visits all the ComponentInstance objects in the given instance
model in prefix order. |
org.eclipse.emf.common.util.EList |
processPreOrderComponentInstance(ComponentInstance obj,
ComponentCategory cat)
Visits all the ComponentInstance objects of the given category in
the given instance model in prefix order. |
static java.util.Set |
processResources(java.util.Set inputResourceSet,
ForAllAObject[] switches,
java.util.Set outputBad)
Run a series of traversals over a set of resources, recording those that passed and those that failed. |
java.util.Set |
processResources(java.util.Set inputResourceSet,
java.util.Set outputBad)
Run the default traversal over a set
of resources, recording those that passed and those that failed. |
static java.util.Set |
processResourcesIgnoreFailure(java.util.Set inputResourceSet,
ForAllAObject[] switches,
java.util.Set outputBad)
Run a series of traversals over a set of resources, recording those that passed and those that failed. |
org.eclipse.emf.common.util.EList |
processTopDownComponentClassifier(ComponentImpl root)
Visits all the Component Classifiers used in subtree rooted at the given node in a prefix order. |
org.eclipse.emf.common.util.EList |
processTopDownComponentClassifierAllDeclarativeModels()
Process all declarative AADL models in the AadlWorkspace according to the top-down component-classifier ordering; see processTopDownComponentClassifier(ComponentImpl) for more
information. |
org.eclipse.emf.common.util.EList |
processTopDownComponentImpl()
Process all declarative AADL models in the AadlWorkspace according to the top-down component implementation ordering; see processTopDownComponentImpl(ComponentImpl) for more
information. |
org.eclipse.emf.common.util.EList |
processTopDownComponentImpl(ComponentImpl root)
Visits all the Component Implementations used in the subtree rooted at the given node in a prefix order. |
static int |
processTree(AObject root,
ForAllAObject[] switches)
Run a series of traversals over a tree rooted at a given AObject. |
static void |
processTreeIgnoreFailure(AObject root,
ForAllAObject[] switches)
Run a series of traversals over a tree rooted at a given AObject. |
protected boolean |
suchThat(AObject obj)
Method used to filter out objects during traversal. |
void |
warning(AObject 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(AObject obj,
java.lang.String msg,
java.lang.String[] attrs,
java.lang.Object[] values)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String copyright
public static final int NO_DEFAULT
defaultTraversal(AObject)
,
defaultTraversal(List)
, etc. will fail with
an UnsupportedOperationException
.
public static final int PROCESS_BOTTOM_UP_COMPONENT_IMPL
processBottomUpComponentImpl(ComponentImpl)
.
public static final int PROCESS_POST_ORDER_ALL
processPostOrderAll(AObject)
.
public static final int PROCESS_PRE_ORDER_ALL
processPreOrderAll(AObject)
.
public static final int PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
processTopDownComponentClassifier(ComponentImpl)
.
public static final int PROCESS_TOP_DOWN_COMPONENT_IMPL
processTopDownComponentImpl(ComponentImpl)
.
public static final int DEFAULT_DEFAULT_TRAVERSAL
PROCESS_PRE_ORDER_ALL
.
protected final org.eclipse.emf.common.util.EList resultList
action(AObject)
adds
the visited model object to the list.
Constructor Detail |
---|
public ForAllAObject(int defTraversal, AnalysisErrorReporterManager errMgr)
defTraversal
- The default traversal algorithm. One of
NO_DEFAULT
,
PROCESS_BOTTOM_UP_COMPONENT_IMPL
,
PROCESS_POST_ORDER_ALL
,
PROCESS_PRE_ORDER_ALL
,
PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
, or
PROCESS_TOP_DOWN_COMPONENT_IMPL
.errMgr
- The analysis error manager to use to report error results.public ForAllAObject(int defTraversal)
the null error
mananger
and the given default traversal algorithm.
defTraversal
- The default traversal algorithm. One of
NO_DEFAULT
,
PROCESS_BOTTOM_UP_COMPONENT_IMPL
,
PROCESS_POST_ORDER_ALL
,
PROCESS_PRE_ORDER_ALL
,
PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
, or
PROCESS_TOP_DOWN_COMPONENT_IMPL
.public ForAllAObject(AnalysisErrorReporterManager errMgr)
default default traversal algorithm
.
errMgr
- The analysis error manager to use to report error results.public ForAllAObject()
the null error
mananger
the
default default traversal algorithm
.
Method Detail |
---|
protected void process(AObject theAObject)
processEList(EList)
,
processPreOrderAll(AObject)
, etc.). The default implementation
is
protected void process(AObject theAObject) { if (suchThat(theAObject)) { action(theAObject); } }
But subclasses can reimplement this method to do anything.
action(AObject)
,
suchThat(AObject)
public final void processObject(AObject theAObject)
process(AObject)
. This method exists to satisfy the
IProcessingMethod
interface. I would have preferred to have
a process
method in the interface, but I cannot because
the ForAllAObject.process
method is protected
.
If I put the method in an interface, I would have to make the method
public
, which could break existing code.
theAObject
- The element to process.public final org.eclipse.emf.common.util.EList processEList(org.eclipse.emf.common.util.EList list)
process(AObject)
on
every element of the list in order. The default implementations of
process(AObject)
, suchThat(edu.cmu.sei.aadl.model.core.AObject)
, and action(edu.cmu.sei.aadl.model.core.AObject)
mean
that by default this method just returns the input list of elements. It
can be used to filter out elements by overriding
suchThat(AObject)
.
This method checks notCancelled()
after each element in the list,
and terminates the processing if the traversal has been cancelled.
list
- EList of AObjects
process(AObject)
,
cancelTraversal()
,
notCancelled()
protected boolean suchThat(AObject obj)
process(AObject)
:
protected void process(AObject theAObject) { if (suchThat(theAObject)) { action(theAObject); } }
By default, this method returns true
.
obj
- The object to test
process(AObject)
,
action(AObject)
protected void action(AObject obj)
process(AObject)
:
protected void process(AObject theAObject) { if (suchThat(theAObject)) { action(theAObject); } }
By default, this method adds the object to resultList
. But this
method can do anything.
obj
- The object to visit.suchThat(AObject)
,
process(AObject)
public org.eclipse.emf.common.util.EList getResultList()
process(AObject)
.
protected final void cancelTraversal()
public
because there is no sense in outsiders calling this
method.
cancelled()
,
notCancelled()
public final boolean cancelled()
cancelTraversal()
, this method
is public
: it is interesting for the user of the traversal
to learn if the traversal was cancelled.
notCancelled
public final boolean notCancelled()
cancelTraversal()
, this method
is public
: it is interesting for the user of the traversal
to learn if the traversal was cancelled.
Most the time it is more interesting to know that the traversal wasn't cancelled, than to know that it was cancelled.
cancelled()
public final org.eclipse.emf.common.util.EList defaultTraversal(AObject obj)
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
obj
- The root object to start the traversal.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList defaultTraversal(java.util.List objs)
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
objs
- List of root objects.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.defaultTraversalMethod
,
cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList defaultTraversalAllDeclarativeModels()
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.defaultTraversalMethod
,
cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList defaultTraversalAllInstances()
PROCESS_BOTTOM_UP_COMPONENT_IMPL
,
PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
, or
PROCESS_TOP_DOWN_COMPONENT_IMPL
then this will throw an
UnsupportedOperationException
.
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.defaultTraversalMethod
,
cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPreOrderAll(AObject obj)
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
obj
- The root object of the traversal.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPreOrderAll(org.eclipse.emf.common.util.EList objlist)
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
objlist
- The roots nodes to be visited.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPreOrderAll()
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPreOrderAllDeclarativeModels()
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPreOrderAllInstances()
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPreOrderComponentInstance(ComponentInstance obj)
ComponentInstance
objects in the given instance
model in prefix order. Takes into account the current mode when
traversing the content hierarchy of model instances.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
obj
- The root object for the traversal.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPreOrderComponentInstance(ComponentInstance obj, ComponentCategory cat)
ComponentInstance
objects of the given category in
the given instance model in prefix order. Takes into account the current
mode when traversing the content hierarchy of model instances.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
obj
- The root object for the traversal.cat
- The category of the component instances to visit.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPostOrderAll(AObject obj)
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
obj
- The root object of the traversal.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPostOrderAll(org.eclipse.emf.common.util.EList objlist)
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
objlist
- The roots nodes to be visited.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPostOrderAll()
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPostOrderAllDeclarativeModels()
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPostOrderAllInstances()
This method checks notCancelled()
after visiting each element, and
terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPostOrderComponentInstance(ComponentInstance obj)
ComponentInstance
objects in the given instance
model in post fix order. Takes into account the current mode when
traversing the content hierarchy of model instances.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
obj
- The root object for the traversal.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processPostOrderComponentInstance(ComponentInstance obj, ComponentCategory cat)
ComponentInstance
objects that are of the given
component category (e.g., system, data, thread, etc.) in the given
instance model in post fix order. Takes into account the current mode
when traversing the content hierarchy of model instances.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
obj
- The root object for the traversal.cat
- The category.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processTopDownComponentClassifier(ComponentImpl root)
A particular classifier may be visited more than once.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
root
- The root node.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processTopDownComponentClassifierAllDeclarativeModels()
processTopDownComponentClassifier(ComponentImpl)
for more
information.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processTopDownComponentImpl(ComponentImpl root)
A particular classifier may be visited more than once.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
root
- The root node.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processTopDownComponentImpl()
processTopDownComponentImpl(ComponentImpl)
for more
information.
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processBottomUpComponentImpl(ComponentImpl root)
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processBottomUpComponentImpl()
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public final org.eclipse.emf.common.util.EList processAllComponentImpl()
This method checks notCancelled()
after visiting each element,
and terminates the processing if the traversal has been cancelled.
resultList
. The contents of this list
depend on the implementation of process(edu.cmu.sei.aadl.model.core.AObject)
/action(edu.cmu.sei.aadl.model.core.AObject)
.cancelTraversal()
,
notCancelled()
,
process(AObject)
public static java.util.Set processResources(java.util.Set inputResourceSet, ForAllAObject[] switches, java.util.Set outputBad)
j
are analyzed by analysis j+1
.
Pass/fail is determined by whether the the number of errors on the
resource increased after an analysis was run. Errors are determined
by checking the error count (via ErrorReporter.getNumErrors()
)
on the error reporter associated with each Resource. The union of the returned
set with the elements added to outputBad
equals inputResourceSet
.
inputResourceSet
- Set of resources to analyse. The analysis is run on each
resource in turn. The resources are assumed to be AADL Object
models, that is the Resource.getContents()
returns a
one-element list whose element is an
AadlSpec
object.switches
- The analyses to run, as an array of length >= 1. Each analysis
is invoked using its
default traversal
outputBad
- Set that is modified by the method to include all elements of
inputResourceSet
that fail the series analyses.
inputResourceSet
that pass all the
analyses.public static java.util.Set processResourcesIgnoreFailure(java.util.Set inputResourceSet, ForAllAObject[] switches, java.util.Set outputBad)
processResources(Set, ForAllAObject[], Set)
in that all the
traversals are run over all the resources regardless of whether a
previous traversal failed. Errors are determined by checking the error
count (via
ErrorReporter.getNumErrors()
)
on the error reporter associated with each Resource. The union of the
returned set with the elements added to outputBad
equals
inputResourceSet
.
inputResourceSet
- Set of resources to analyse. The analysis is run on each
resource in turn. The resources are assumed to be AADL Object
models, that is the Resource.getContents()
returns a
one-element list whose element is an
AadlSpec
object.switches
- The analyses to run, as an array of length >= 1. Each analysis
is invoked using its
default traversal
outputBad
- Set that is modified by the method to include all elements of
inputResourceSet
that fail the series analyses.
inputResourceSet
that pass all the
analyses.public final java.util.Set processResources(java.util.Set inputResourceSet, java.util.Set outputBad)
default traversal
over a set
of resources, recording those that passed and those that failed.
Pass/fail is determined by whether the the number of errors on the
resource—as determined by error manager associated with the
traversal object—increased after the analysis was run. The union of
the return value and the elements added to outputBad
equals
inputResourceSet
.
inputResourceSet
- Set of resources to analyse. The analysis is run on each
resource in turn. The resources are assumed to be AADL Object
models, that is the Resource.getContents()
returns a
one-element list whose element is an
AadlSpec
object.outputBad
- Set that is modified by the method to include all elements of
inputResourceSet
that fail the analysis.
inputResourceSet
that pass all the
analyses.public static int processTree(AObject root, ForAllAObject[] switches)
root
- The AObject that is the root of the tree to traverse.switches
- The analyses to run, as an array of length >= 1. Each analysis
is invoked using its
default traversal
switches.length-1
. If none of the traversals were
successful, this value is -1
.public static void processTreeIgnoreFailure(AObject root, ForAllAObject[] switches)
root
- The AObject that is the root of the tree to traverse.switches
- The analyses to run, as an array of length >= 1. Each analysis
is invoked using its
default traversal
public final AnalysisErrorReporterManager getErrorManager()
public final void internalError(java.lang.String message)
message
- The error message.public final void internalError(java.lang.Exception e)
e
- The exception causing the error.public final void error(AObject obj, java.lang.String msg)
Resource
.
obj
- the object to which the marker is pointingmsg
- the message as stringpublic final void error(AObject obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)
public final void warning(AObject obj, java.lang.String msg)
Resource
.
obj
- the object to which the marker is pointingmsg
- the message as stringpublic final void warning(AObject obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)
public final void info(AObject obj, java.lang.String msg)
Resource
.
obj
- the object to which the marker is pointingmsg
- the message as stringpublic final void info(AObject obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |