public class ForAllElement
extends java.lang.Object
Processing of model elements is performed by the process(Element)
method, which by default calls suchThat(Element)
to evaluate a
condition and then action(Element)
to perform an action. The default
condition is true
and the default action is to add the visited
Element to a resultList. Subclasses can either override suchThat(org.osate.aadl2.Element)
and
or action(org.osate.aadl2.Element)
to get the desired filtering effects, or they can override
process(org.osate.aadl2.Element)
directly.
Traversals may append objects to a result list. The default implementation of
action(org.osate.aadl2.Element)
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(Element)
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.
Modifier and Type | Field and Description |
---|---|
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(ComponentImplementation) . |
static int |
PROCESS_POST_ORDER_ALL
Constant indicating the default traversal method is
processPostOrderAll(Element) . |
static int |
PROCESS_PRE_ORDER_ALL
Constant indicating the default traversal method is
processPreOrderAll(Element) . |
static int |
PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
Constant indicating the default traversal method is
processTopDownComponentClassifier(ComponentImplementation) . |
static int |
PROCESS_TOP_DOWN_COMPONENT_IMPL
Constant indicating the default traversal method is
processTopDownComponentImpl(ComponentImplementation) . |
Constructor and Description |
---|
ForAllElement()
Create a new traversal that uses
the null error
mananger the default default traversal
algorithm . |
ForAllElement(AnalysisErrorReporterManager errMgr)
Create a new traversal that uses the given error manager and uses the
default default traversal algorithm . |
ForAllElement(int defTraversal)
Create a new traversal that uses
the null error
mananger and the given default traversal algorithm. |
ForAllElement(int defTraversal,
AnalysisErrorReporterManager errMgr)
Create a new traversal that uses the given error manager and uses the
given default traversal algorithm.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancelled()
Test if we are cancelled.
|
org.eclipse.emf.common.util.EList<Element> |
defaultTraversal(Element obj)
Execute the default traversal algorithm using the given root object.
|
org.eclipse.emf.common.util.EList<Element> |
defaultTraversal(java.util.List<? extends Element> 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(Element obj,
java.lang.String msg)
Report an error on an Element (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) |
AnalysisErrorReporterManager |
getErrorManager()
Get the analysis error reporter manager associated with this traversal.
|
org.eclipse.emf.common.util.EList<Element> |
getResultList()
Get the result list of the traversal.
|
void |
info(Element obj,
java.lang.String msg)
Report an information message on an Element (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 |
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.
|
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(ComponentImplementation root)
Visits all the component implementations in the subtree rooted at the
given node in reverse containment order.
|
org.eclipse.emf.common.util.EList<Element> |
processEList(org.eclipse.emf.common.util.EList<? extends Element> list)
Processes a list of Elements by invoking
process(Element) on
every element of the list in order. |
void |
processObject(Element theElement)
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<Element> |
processPostOrderAll(Element 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<Element> |
processPostOrderComponentInstance(ComponentInstance obj)
Visits all the
ComponentInstance objects in the given instance
model in post fix order. |
org.eclipse.emf.common.util.EList<Element> |
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<Element> |
processPreOrderAll(Element 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<Element> |
processPreOrderComponentInstance(ComponentInstance obj)
Visits all the
ComponentInstance objects in the given instance
model in prefix order. |
org.eclipse.emf.common.util.EList<Element> |
processPreOrderComponentInstance(ComponentInstance obj,
ComponentCategory cat)
Visits all the
ComponentInstance objects of the given category in
the given instance model in prefix order. |
org.eclipse.emf.common.util.EList |
processPreOrderComponentInstanceStop(ComponentInstance obj)
Modifies processPreOrderComponentInstance to stop processing down
when a component with error model is found
If the suchThat method returned true, it means an error model subclause was found
and we stop traversing the model down
Does preorder processing of Component Instance containment hierarchy
Takes into account the current mode when traversing the content hierarchy
of model instances The default implementation applies the suchThat
condition and if true adds the element to the result list
|
static java.util.Set<org.eclipse.emf.ecore.resource.Resource> |
processResources(java.util.Set<? extends org.eclipse.emf.ecore.resource.Resource> inputResourceSet,
ForAllElement[] switches,
java.util.Set<? super org.eclipse.emf.ecore.resource.Resource> outputBad)
Run a series of traversals over a set of resources, recording those that
passed and those that failed.
|
java.util.Set<org.eclipse.emf.ecore.resource.Resource> |
processResources(java.util.Set<? extends org.eclipse.emf.ecore.resource.Resource> inputResourceSet,
java.util.Set<? super org.eclipse.emf.ecore.resource.Resource> outputBad)
Run the
default traversal over a set
of resources, recording those that passed and those that failed. |
static java.util.Set<org.eclipse.emf.ecore.resource.Resource> |
processResourcesIgnoreFailure(java.util.Set<? extends org.eclipse.emf.ecore.resource.Resource> inputResourceSet,
ForAllElement[] switches,
java.util.Set<? super org.eclipse.emf.ecore.resource.Resource> 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<Element> |
processTopDownComponentClassifier(ComponentImplementation 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(ComponentImplementation) 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(ComponentImplementation) for more information. |
org.eclipse.emf.common.util.EList |
processTopDownComponentImpl(ComponentImplementation root)
Visits all the Component Implementations used in the subtree rooted at
the given node in a prefix order.
|
static int |
processTree(Element root,
ForAllElement[] switches)
Run a series of traversals over a tree rooted at a given Element.
|
static void |
processTreeIgnoreFailure(Element root,
ForAllElement[] switches)
Run a series of traversals over a tree rooted at a given Element.
|
void |
warning(Element obj,
java.lang.String msg)
Report a warning on an Element (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) |
public static final java.lang.String copyright
public static final int NO_DEFAULT
defaultTraversal(Element)
,
defaultTraversal(List)
, etc. will fail with an
UnsupportedOperationException
.public static final int PROCESS_BOTTOM_UP_COMPONENT_IMPL
processBottomUpComponentImpl(ComponentImplementation)
.public static final int PROCESS_POST_ORDER_ALL
processPostOrderAll(Element)
.public static final int PROCESS_PRE_ORDER_ALL
processPreOrderAll(Element)
.public static final int PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER
processTopDownComponentClassifier(ComponentImplementation)
.public static final int PROCESS_TOP_DOWN_COMPONENT_IMPL
processTopDownComponentImpl(ComponentImplementation)
.public static final int DEFAULT_DEFAULT_TRAVERSAL
PROCESS_PRE_ORDER_ALL
.public ForAllElement(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 ForAllElement(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 ForAllElement(AnalysisErrorReporterManager errMgr)
default default traversal algorithm
.errMgr
- The analysis error manager to use to report error results.public ForAllElement()
the null error
mananger
the default default traversal
algorithm
.public final void processObject(Element theElement)
process(Element)
.
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 ForAllElement.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.theElement
- The element to process.public final org.eclipse.emf.common.util.EList<Element> processEList(org.eclipse.emf.common.util.EList<? extends Element> list)
process(Element)
on
every element of the list in order. The default implementations of
process(Element)
, suchThat(org.osate.aadl2.Element)
, and action(org.osate.aadl2.Element)
mean
that by default this method just returns the input list of elements. It
can be used to filter out elements by overriding
suchThat(Element)
.
This method checks notCancelled()
after each element in the
list, and terminates the processing if the traversal has been cancelled.
list
- EList of Elementsprocess(Element)
,
cancelTraversal()
,
notCancelled()
public org.eclipse.emf.common.util.EList<Element> getResultList()
process(Element)
.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<Element> defaultTraversal(Element 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList<Element> defaultTraversal(java.util.List<? extends Element> 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.defaultTraversalMethod
,
cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.defaultTraversalMethod
,
cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.defaultTraversalMethod
,
cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList<Element> processPreOrderAll(Element 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList<Element> 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList<Element> 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList processPreOrderComponentInstanceStop(ComponentInstance obj)
obj
- InstanceObject root objectpublic final org.eclipse.emf.common.util.EList<Element> processPostOrderAll(Element 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList<Element> 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList<Element> 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList<Element> processTopDownComponentClassifier(ComponentImplementation 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList processTopDownComponentClassifierAllDeclarativeModels()
processTopDownComponentClassifier(ComponentImplementation)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList processTopDownComponentImpl(ComponentImplementation 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList processTopDownComponentImpl()
processTopDownComponentImpl(ComponentImplementation)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public final org.eclipse.emf.common.util.EList processBottomUpComponentImpl(ComponentImplementation 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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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(org.osate.aadl2.Element)
/action(org.osate.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public static java.util.Set<org.eclipse.emf.ecore.resource.Resource> processResources(java.util.Set<? extends org.eclipse.emf.ecore.resource.Resource> inputResourceSet, ForAllElement[] switches, java.util.Set<? super org.eclipse.emf.ecore.resource.Resource> 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
edu.cmu.sei.aadl.model.pluginsupport.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
edu.cmu.sei.aadl.model.core.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<org.eclipse.emf.ecore.resource.Resource> processResourcesIgnoreFailure(java.util.Set<? extends org.eclipse.emf.ecore.resource.Resource> inputResourceSet, ForAllElement[] switches, java.util.Set<? super org.eclipse.emf.ecore.resource.Resource> outputBad)
processResources(Set, ForAllElement[], 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
edu.cmu.sei.aadl.model.pluginsupport.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
edu.cmu.sei.aadl.model.core.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<org.eclipse.emf.ecore.resource.Resource> processResources(java.util.Set<? extends org.eclipse.emf.ecore.resource.Resource> inputResourceSet, java.util.Set<? super org.eclipse.emf.ecore.resource.Resource> 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
edu.cmu.sei.aadl.model.core.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(Element root, ForAllElement[] switches)
root
- The Element 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(Element root, ForAllElement[] switches)
root
- The Element 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(Element obj, java.lang.String msg)
Resource
.obj
- the object to which the marker is pointingmsg
- the message as stringpublic final void error(Element obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)
public final void warning(Element obj, java.lang.String msg)
Resource
.obj
- the object to which the marker is pointingmsg
- the message as stringpublic final void warning(Element obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)
public final void info(Element obj, java.lang.String msg)
Resource
.obj
- the object to which the marker is pointingmsg
- the message as stringpublic final void info(Element obj, java.lang.String msg, java.lang.String[] attrs, java.lang.Object[] values)