fr.tpt.aadl.annex.behavior.utils
Class AadlBaVisitors

java.lang.Object
  extended by fr.tpt.aadl.annex.behavior.utils.AadlBaVisitors

public class AadlBaVisitors
extends java.lang.Object

A collection of behavior annex visitors.


Field Summary
static long DEFAULT_TRANSITION_PRIORITY
           
static java.lang.String INITIALIZE_ENTRYPOINT_PROPERTY_NAME
           
static java.lang.String INITIALIZE_ENTRYPOINT_PROPERTYSET
           
static java.lang.String SEI_AADL2_CLASSIFIER_SUFFIX
           
static java.lang.String SEI_AADL2_PACKAGE_NAME
           
 
Constructor Summary
AadlBaVisitors()
           
 
Method Summary
static BehaviorState findBehaviorState(BehaviorAnnex ba, java.lang.String stateName)
          Find the first occurrence of an BehaviorState within a given BehaviorAnnex which name equals to a given name.
static BehaviorVariable findBehaviorVariable(BehaviorAnnex ba, java.lang.String variableName)
          Find the first occurrence of an BehaviorVariable within a given BehaviorAnnex which name equals to the given name.
static org.osate.aadl2.PackageSection[] getBaPackageSections(BehaviorAnnex ba)
          Return the package sections related to a given BehaviorAnnex.
static org.eclipse.emf.common.util.EList<BasicAction> getBasicActions(BehaviorAction BehAction)
          Returns a list of basic action contained in the given behavior action (recursively).
static org.eclipse.emf.common.util.EList<BasicAction> getBasicActions(BehaviorActions BehActions)
          Return a list of the BasicAction objects contained in a given BehaviorActions object (recursively).
static org.eclipse.emf.common.util.EList<DispatchTrigger> getDispatchTriggers(DispatchTriggerLogicalExpression dtle)
          Return a list of DispatchTrigger objects contained in the given DispatchTriggerLogicelExpression object.
static org.osate.aadl2.ComponentClassifier getParentComponent(BehaviorAnnex ba)
          Returns the behavior annex's parent component.
static java.util.List<BehaviorTransition> getTransitionWhereSrc(BehaviorState state)
          Return a list of behavior transitions where the given behavior state is the source state.
static boolean isFresh(BehaviorAnnex ba, org.osate.aadl2.Port port)
          Return true if the given port which is contained in the given BehaviorAnnex object is used as a fresh port value.
static void putFreshPort(BehaviorAnnex ba, org.osate.aadl2.Port port)
          Tag the given port as a port used as a fresh port value.
static void putTransitionWhereSrc(BehaviorState state, BehaviorTransition bt)
          Specify that the given behavior state is the source state of the given behavior transition.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIALIZE_ENTRYPOINT_PROPERTYSET

public static final java.lang.String INITIALIZE_ENTRYPOINT_PROPERTYSET
See Also:
Constant Field Values

INITIALIZE_ENTRYPOINT_PROPERTY_NAME

public static final java.lang.String INITIALIZE_ENTRYPOINT_PROPERTY_NAME
See Also:
Constant Field Values

SEI_AADL2_PACKAGE_NAME

public static final java.lang.String SEI_AADL2_PACKAGE_NAME
See Also:
Constant Field Values

SEI_AADL2_CLASSIFIER_SUFFIX

public static final java.lang.String SEI_AADL2_CLASSIFIER_SUFFIX
See Also:
Constant Field Values

DEFAULT_TRANSITION_PRIORITY

public static final long DEFAULT_TRANSITION_PRIORITY
Constructor Detail

AadlBaVisitors

public AadlBaVisitors()
Method Detail

getBasicActions

public static org.eclipse.emf.common.util.EList<BasicAction> getBasicActions(BehaviorAction BehAction)
Returns a list of basic action contained in the given behavior action (recursively).

Parameters:
BehAction - the given behavior action
Returns:
a list of basic action contained in the given behavior action

getBasicActions

public static org.eclipse.emf.common.util.EList<BasicAction> getBasicActions(BehaviorActions BehActions)
Return a list of the BasicAction objects contained in a given BehaviorActions object (recursively). If the given BehaviorActions object is null, the returned list is empty.

Parameters:
BehActions - the given BehaviorActions object or null (for batch processing purpose)
Returns:
the list of BasicAction contained in the given BehaviorActions object. May be empty.

getBaPackageSections

public static org.osate.aadl2.PackageSection[] getBaPackageSections(BehaviorAnnex ba)
Return the package sections related to a given BehaviorAnnex. As "Classifier declarations in public sections are accessible to other packages, while classifiers in private sections can only be referenced within the private section of the same package".

table[0] always refers to public section. If the given BehaviorAnnex is declared in a private section, table's length equals to 2 and table[1] refers to the private section.

Parameters:
ba - The given BehaviorAnnex
Returns:
the package sections related to the given BehaviorAnnex.

findBehaviorVariable

public static BehaviorVariable findBehaviorVariable(BehaviorAnnex ba,
                                                    java.lang.String variableName)
Find the first occurrence of an BehaviorVariable within a given BehaviorAnnex which name equals to the given name. Return null if no BehaviorVariable is found.

Parameters:
ba - the given BehaviorAnnex
variableName - the given name
Returns:
the first occurrence of an BehaviorVariable related to the given name or null.

findBehaviorState

public static BehaviorState findBehaviorState(BehaviorAnnex ba,
                                              java.lang.String stateName)
Find the first occurrence of an BehaviorState within a given BehaviorAnnex which name equals to a given name. Return null if no BehaviorState is found.

Parameters:
ba - the given BehaviorAnnex
stateName - the given name
Returns:
the first occurrence of an BehaviorState related to the given name or null

getDispatchTriggers

public static org.eclipse.emf.common.util.EList<DispatchTrigger> getDispatchTriggers(DispatchTriggerLogicalExpression dtle)
Return a list of DispatchTrigger objects contained in the given DispatchTriggerLogicelExpression object. The list may be empty but not null.

Parameters:
dtle - the given DispatchTriggerLogicelExpression object
Returns:
a list of DispatchTrigger objects, eventually empty.

getParentComponent

public static org.osate.aadl2.ComponentClassifier getParentComponent(BehaviorAnnex ba)
Returns the behavior annex's parent component.

Parameters:
ba - the behavior annex
Returns:
the behavior annex's parent component

isFresh

public static boolean isFresh(BehaviorAnnex ba,
                              org.osate.aadl2.Port port)
Return true if the given port which is contained in the given BehaviorAnnex object is used as a fresh port value. Otherwise return false.

Parameters:
ba - the given BehaviorAnnex object which contains the given port
port - the given port
Returns:
true if the given is used as a fresh port value. Otherwise false

putFreshPort

public static void putFreshPort(BehaviorAnnex ba,
                                org.osate.aadl2.Port port)
Tag the given port as a port used as a fresh port value.

Parameters:
ba - the BehaviorAnnex object which contains the given port
port - the given port

getTransitionWhereSrc

public static java.util.List<BehaviorTransition> getTransitionWhereSrc(BehaviorState state)
Return a list of behavior transitions where the given behavior state is the source state. May return empty list.

The list of behavior transitions is sorted according to:

_ the behavior priority (highest to the lowest).
_ the behavior transitions which have "otherwise" execution condition are set at the end of the list.
_ in case of equality, the order of behavior transition appearance in the aadl code is applied.

Parameters:
state - the given behavior state
Returns:
the list of behavior transitions where the given behavior state is the source state or an empty list

putTransitionWhereSrc

public static void putTransitionWhereSrc(BehaviorState state,
                                         BehaviorTransition bt)
Specify that the given behavior state is the source state of the given behavior transition.

Parameters:
state - the given behavior state
bt - the given behavior transition where the the given behavior state is source