de.cau.cs.kieler.synccharts.text.actions.bridge
Class ActionLabelProcessorWrapper

java.lang.Object
  extended by de.cau.cs.kieler.synccharts.text.actions.bridge.ActionLabelProcessorWrapper

public class ActionLabelProcessorWrapper
extends Object

A wrapper class that provides methods to process (i.e. parse or serialize) Action labels (i.e. transition labels or entry, inner, exit, suspend actions of states).

Rating proposed yellow
(2010-01-19) proposed by haf

Field Summary
static boolean PARSE
           
static boolean SERIALIZE
           
 
Constructor Summary
ActionLabelProcessorWrapper()
          Default Constructor initializes parsers and serializers.
 
Method Summary
 Command getProcessActionCommand(Action action, boolean parse)
           
 Command getProcessAffectedActionLabelCommand(ValuedObject changedObject, EObject theParent, boolean parse)
           
static void processActionLabels(EObject parent, boolean parse)
          Trigger the parsing or serialization of Action labels of a given scope.
 void processAffectedActionLabels(ValuedObject changedObject, EObject theParent, boolean parse)
          Recursively parse or serialize all Action objects starting from the parent object and recursively calling it to child states resp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARSE

public static final boolean PARSE
See Also:
Constant Field Values

SERIALIZE

public static final boolean SERIALIZE
See Also:
Constant Field Values
Constructor Detail

ActionLabelProcessorWrapper

public ActionLabelProcessorWrapper()
Default Constructor initializes parsers and serializers.

Method Detail

processAffectedActionLabels

public void processAffectedActionLabels(ValuedObject changedObject,
                                        EObject theParent,
                                        boolean parse)
                                 throws KielerModelException,
                                        IOException
Recursively parse or serialize all Action objects starting from the parent object and recursively calling it to child states resp. child regions. All state actions (entry, exit, inner, suspension) and all transitions will be serialized or parsed again. If the parent is null, the parent is determined by the container object of the given Signal/Variable. If the changed object is null, then all children of the parent will be processed. If both are null, this cannot be handled and will silently return.

Parameters:
changedObject - the Signal/Variable that has changed its name
theParent - the current parent object, either State or Region
parse - true if the label should be reparsed, false if it should be serialized
Throws:
IOException - unlikely parser IO error
KielerModelException - possible parser syntax errors

getProcessAffectedActionLabelCommand

public Command getProcessAffectedActionLabelCommand(ValuedObject changedObject,
                                                    EObject theParent,
                                                    boolean parse)

processActionLabels

public static void processActionLabels(EObject parent,
                                       boolean parse)
                                throws Exception
Trigger the parsing or serialization of Action labels of a given scope. Starting from a given parent (i.e. State or Region) recursively iterate all Actions contained, i.e. all transitions and all entry, inner, exit and suspension actions. Parse/Serialize the found actions. Execute in a GMF command on the model's command stack to get access to the model.

Parameters:
parent - the context to start the action search
parse - true, if parsing, false if serializing
Throws:
Exception - if parsing has failed

getProcessActionCommand

public Command getProcessActionCommand(Action action,
                                       boolean parse)