|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sei.aadl.modelsupport.modeltraversal.ForAllElement
public class ForAllElement
ForAllElement plays the role of an iterator object that supports traversal of AADL models Encapsulates traversal algorithms over models. Each instance of ForAllElement contains a resultList that holds all visited model objects as result of the default action.
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(edu.cmu.sei.aadl.aadl2.Element)
and
or action(edu.cmu.sei.aadl.aadl2.Element)
to get the desired filtering effects, or they can override
process(edu.cmu.sei.aadl.aadl2.Element)
directly.
Traversals may append objects to a result list. The default implementation of
action(edu.cmu.sei.aadl.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.
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(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(ComponentImpl) . |
static int |
PROCESS_TOP_DOWN_COMPONENT_IMPL
Constant indicating the default traversal method is #processTopDownComponentImpl(ComponentImpl) . |
protected org.eclipse.emf.common.util.EList<Element> |
resultList
This list is returned as the result value of the various traversal methods. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
protected void |
action(Element 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<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. |
protected void |
process(Element theElement)
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(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. |
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(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(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. |
protected boolean |
suchThat(Element obj)
Method used to filter out objects during traversal. |
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)
|
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(Element)
,
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(Element)
.
public static final int PROCESS_PRE_ORDER_ALL
processPreOrderAll(Element)
.
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<Element> resultList
action(Element)
adds the visited model object
to the list.
Constructor Detail |
---|
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
.
Method Detail |
---|
protected void process(Element theElement)
processEList(EList)
,
processPreOrderAll(Element)
, etc.). The default implementation
is
protected void process(Element theElement) { if (suchThat(theElement)) { action(theElement); } }
But subclasses can reimplement this method to do anything.
action(Element)
,
suchThat(Element)
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(edu.cmu.sei.aadl.aadl2.Element)
, and action(edu.cmu.sei.aadl.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 Elements
process(Element)
,
cancelTraversal()
,
notCancelled()
protected boolean suchThat(Element obj)
process(Element)
:
protected void process(Element theElement) { if (suchThat(theElement)) { action(theElement); } }
By default, this method returns true
.
obj
- The object to test
process(Element)
,
action(Element)
protected void action(Element obj)
process(Element)
:
protected void process(Element theElement) { if (suchThat(theElement)) { action(theElement); } }
By default, this method adds the object to resultList
. But this
method can do anything.
obj
- The object to visit.suchThat(Element)
,
process(Element)
public org.eclipse.emf.common.util.EList<Element> getResultList()
process(Element)
.
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<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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
public 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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.aadl2.Element)
.cancelTraversal()
,
notCancelled()
,
process(Element)
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.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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(edu.cmu.sei.aadl.aadl2.Element)
/action(edu.cmu.sei.aadl.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |