UML Modeling Layer

com.ibm.xtools.uml.msl.internal.redefinition
Class RedefTransitionUtil

java.lang.Object
  extended by com.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil
      extended by com.ibm.xtools.uml.msl.internal.redefinition.RedefUtil
          extended by com.ibm.xtools.uml.msl.internal.redefinition.RedefTransitionUtil

public class RedefTransitionUtil
extends RedefUtil


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefUtil
RedefUtil.ElementWithRedefinitionContext, RedefUtil.IRedefintionContextAccessor
 
Nested classes/interfaces inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil
RedefInternalUtil.ContainmentTester
 
Field Summary
 
Fields inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefUtil
CONTEXT_HINT, EDIT_REQUEST_PARAM_SUPRESS_UI, redefUtilInstance, REFACTORING_ROOT_FRAGMENT_REMOVAL
 
Fields inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil
defaultContainmentTester, EMPTY_BEHAVIOR_BODY, uml2
 
Constructor Summary
RedefTransitionUtil()
           
 
Method Summary
static void excludeTrigger(Trigger trigger, Transition trans, EObject contextHint)
          Excludes the given trigger from this transition's contextual fragment
static List getAllTriggers(Transition transition, EObject contextHint)
          Utility method to get the set of Inherited + Local - Redefined Triggers
static Behavior getEffect(Transition transition, EObject contextHint)
          Utility method to get the Effect
static String getEffectCode(Transition t, EObject contextHint, String language)
          Utility method to get a local or inherited effect code for the given transition and given language
static Constraint getGuard(Transition transition, EObject contextHint)
          Utility method to get the Guard
static Map getGuardCode(Transition t, EObject contextHint)
          Utility method to get a local or inherited guard code for the given transition and all languages
static String getGuardCode(Transition t, EObject contextHint, String language)
          Utility method to get a local or inherited guard code for the given transition and given language
static List getGuardLanguages(Transition t, EObject contextHint)
           
static TransitionKind getKind(Transition fragment)
           
static Behavior getLocalEffect(Transition transition)
          Use it instead of calling transition.getEffect() directly
static Constraint getLocalGuard(Transition transition)
          use it instead of calling transition.getGuard() directly
static Vertex getLocalSource(Transition transition)
          Use it instead of calling transition.getSource() directly
static Vertex getLocalTarget(Transition transition)
          use it instead of calling transition.getTarget() directly
static List getLocalTriggers(Transition transition)
          Use it instead of calling transition.getTriggers() directly
static Vertex getSource(Transition transition, EObject contextHint)
          Returns the transition source taking into account redefinition
static Vertex getTarget(Transition transition, EObject contextHint)
          Returns the transition target taking into account redefinition
static Constraint getTriggerGuard(Trigger trigger, EObject contextHint)
          Utility method to get the Trigger Guard
static String getTriggerGuardCode(Trigger trigger, EObject contextHint, String language)
          Utility method to get a local or inherited guard code for the given trigger and given language
static boolean isEffectInherited(Transition t, EObject contextHint, String language)
          Utility method - is the effect code inherited for the given transition and given language
static boolean isEffectRedefined(Transition t, EObject contextHint, String language)
          Determines if the Effect's OpaqueBehavior body is redefined in this context
static boolean isExcluded(Trigger trigger, Transition trans, EObject contextHint)
          Determines if the given trigger is exluded for the given transition
static boolean isGuardInherited(Transition t, EObject contextHint, String language)
          Utility method - is the guard code inherited for the given transition and given language
static boolean isGuardRedefined(Transition t, EObject contextHint, String language)
          Determines if the Guard's OpaqueExpresion's body is redefined in this context
static boolean isTriggerGuardInherited(Trigger trigger, EObject contextHint)
          Utility method - is the guard inherited for the given trigger
static boolean isTriggerGuardLocal(Trigger trigger, EObject contextHint, String language)
          Utility method - is the guard local for the given trigger and given language
static boolean isTriggerGuardRedefined(Trigger trigger, EObject contextHint, String language)
          Utility method - is the guard redefined for the given trigger
static void removeEffect(Transition t, EObject contextHint, String language)
          Utility method to remove transition effect code.
static void removeGuard(Transition t, EObject contextHint, String language)
          Utility method to remove transition guard code.
static void setRedefinedTransition(Transition redefining, Transition redefined)
           
static void setSource(Transition t, Vertex v)
          Sets transition source.
static void setTarget(Transition t, Vertex v)
          Sets transition target.
static void unexcludeTrigger(Trigger trigger, Transition trans, EObject contextHint)
          Unexcludes (re-inherit) the given trigger from the transition's contextual fragment.
 
Methods inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefUtil
canRedefine, canRedefine, canReinherit, canReinheritViewTarget, changeRedefinitionRoot, copyAllRedefinableContent, copyLocalRedefinableContent, copySharedContent, getAdapterForEditPart, getAffectedFilesFromContextHint, getAllStructuralFeatureContent, getContainingStateMachine, getContextHint, getContextHintMap, getContextualFragment, getContextualFragment, getInheritanceTree, getInheritedContent, getInstance, getLocalContext, getLocalContextFromHint, getLocalContextFromHint, getLocalContextIfExists, getLocalFragment, getRedefinableFeatures, getRedefinedElement, getRedefinedElementOrSuperClass, getRedefinitions, getRedefinitionStructuralFeature, getRedefinitionTree, getReferencesTargets, getReferenceTarget, getReferenceTarget, getRootFragment, getSharedFeatures, getStereotypeValue, getSubclasses, getValue, isEventBrokerRedefinitionAware, isExcluded, isExcluded, isFragmentRemovalRefactoring, isInheritable, isInherited, isLocal, isRedefinitionContextValid, isRedefinitionStructuredFeature, isStereotypePropertyRedefinable, isStereotypeValueInherited, isUISuppressed, isUMLRedefinitionStructuralFeature, isValueLocal, markFragmentRemovalRefactoring, normalizeContextHint, redefine, redefine, reinherit, removeFragment, separate, setRedefinition, setSupressUIParam, unexclude
 
Methods inherited from class com.ibm.xtools.uml.msl.internal.redefinition.RedefInternalUtil
filterBySF, findBody, findBody, findOwner, findOwner, findSubclasses, findSubclasses, getContainedElement, getContextChain, getExclusionSupport, getRedefSupport, retargetReferences, retargetReferencesDownTheContextChain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedefTransitionUtil

public RedefTransitionUtil()
Method Detail

getLocalGuard

public static Constraint getLocalGuard(Transition transition)
use it instead of calling transition.getGuard() directly

Parameters:
transition -
Returns:

getGuard

public static Constraint getGuard(Transition transition,
                                  EObject contextHint)
Utility method to get the Guard

Parameters:
t - the transition
Returns:
local or inherited Guard

getTriggerGuard

public static Constraint getTriggerGuard(Trigger trigger,
                                         EObject contextHint)
Utility method to get the Trigger Guard

Parameters:
trigger -
Returns:
local or inherited Guard

getLocalEffect

public static Behavior getLocalEffect(Transition transition)
Use it instead of calling transition.getEffect() directly

Parameters:
transition -
Returns:

getEffect

public static Behavior getEffect(Transition transition,
                                 EObject contextHint)
Utility method to get the Effect

Parameters:
t - the transition
Returns:
local or inherited Effect

getLocalSource

public static Vertex getLocalSource(Transition transition)
Use it instead of calling transition.getSource() directly

Parameters:
transition -
Returns:

getSource

public static Vertex getSource(Transition transition,
                               EObject contextHint)
Returns the transition source taking into account redefinition

Parameters:
contextHint - Local context for Transition source
t - The transition
Returns:

getLocalTarget

public static Vertex getLocalTarget(Transition transition)
use it instead of calling transition.getTarget() directly

Parameters:
transition -
Returns:

getTarget

public static Vertex getTarget(Transition transition,
                               EObject contextHint)
Returns the transition target taking into account redefinition

Parameters:
contextHint - Local context for Transition target
t - The transition
Returns:

getLocalTriggers

public static List getLocalTriggers(Transition transition)
Use it instead of calling transition.getTriggers() directly

Parameters:
transition -
Returns:

getAllTriggers

public static List getAllTriggers(Transition transition,
                                  EObject contextHint)
Utility method to get the set of Inherited + Local - Redefined Triggers

Parameters:
transition - the transition
Returns:
list with triggers (never null)

isGuardInherited

public static boolean isGuardInherited(Transition t,
                                       EObject contextHint,
                                       String language)
Utility method - is the guard code inherited for the given transition and given language

Parameters:
transition -
language -
Returns:
true if the code is inherited, false if the code is local or never defined

isGuardRedefined

public static boolean isGuardRedefined(Transition t,
                                       EObject contextHint,
                                       String language)
Determines if the Guard's OpaqueExpresion's body is redefined in this context

Parameters:
t -
contextHint -
language -
Returns:

isEffectRedefined

public static boolean isEffectRedefined(Transition t,
                                        EObject contextHint,
                                        String language)
Determines if the Effect's OpaqueBehavior body is redefined in this context

Parameters:
t -
contextHint -
language -
Returns:

isTriggerGuardInherited

public static boolean isTriggerGuardInherited(Trigger trigger,
                                              EObject contextHint)
Utility method - is the guard inherited for the given trigger

Parameters:
trigger -
Returns:
true if the guard is inherited, false if the guard is local or never defined

isTriggerGuardLocal

public static boolean isTriggerGuardLocal(Trigger trigger,
                                          EObject contextHint,
                                          String language)
Utility method - is the guard local for the given trigger and given language

Parameters:
trigger -
Returns:
true if the guard is inherited, false if the guard is local or never defined

isTriggerGuardRedefined

public static boolean isTriggerGuardRedefined(Trigger trigger,
                                              EObject contextHint,
                                              String language)
Utility method - is the guard redefined for the given trigger

Parameters:
trigger -
Returns:
true if the guard is redefined, false if the guard is local or never defined

getGuardCode

public static String getGuardCode(Transition t,
                                  EObject contextHint,
                                  String language)
Utility method to get a local or inherited guard code for the given transition and given language

Parameters:
transition -
language -
Returns:
the code string or null

getGuardCode

public static Map getGuardCode(Transition t,
                               EObject contextHint)
Utility method to get a local or inherited guard code for the given transition and all languages

Parameters:
transition -
Returns:
the map of language strings to code strings

getGuardLanguages

public static List getGuardLanguages(Transition t,
                                     EObject contextHint)
Parameters:
t -
contextHint -
Returns:

getTriggerGuardCode

public static String getTriggerGuardCode(Trigger trigger,
                                         EObject contextHint,
                                         String language)
Utility method to get a local or inherited guard code for the given trigger and given language

Parameters:
transition -
language -
Returns:
the code string or null

isEffectInherited

public static boolean isEffectInherited(Transition t,
                                        EObject contextHint,
                                        String language)
Utility method - is the effect code inherited for the given transition and given language

Parameters:
transition -
language -
Returns:
true if the code is inherited, false if the code is local or never defined

setSource

public static void setSource(Transition t,
                             Vertex v)
Sets transition source. Transition source is never set to a redefining state, but always to initial redefined state in the redefinition chain

Parameters:
t -
v -

setTarget

public static void setTarget(Transition t,
                             Vertex v)
Sets transition target. Transition target is never set to a redefining state, but always to initial redefined state in the redefinition chain

Parameters:
t -
v -

getEffectCode

public static String getEffectCode(Transition t,
                                   EObject contextHint,
                                   String language)
Utility method to get a local or inherited effect code for the given transition and given language

Parameters:
transition -
language -
Returns:
the code string or null

removeGuard

public static void removeGuard(Transition t,
                               EObject contextHint,
                               String language)
Utility method to remove transition guard code. The code will be removed from the collection or overriden with an empty code as appropriate.

Parameters:
t -
contextHint -
language -

removeEffect

public static void removeEffect(Transition t,
                                EObject contextHint,
                                String language)
Utility method to remove transition effect code. The code will be removed from the collection or overriden with an empty code as appropriate.

Parameters:
t -
contextHint -
language -

isExcluded

public static boolean isExcluded(Trigger trigger,
                                 Transition trans,
                                 EObject contextHint)
Determines if the given trigger is exluded for the given transition

Parameters:
trigger - - The trigger in question
contextHint - - Either the transition's view (if available)
Returns:
true if the trigger is considered excluded in the given context. false otherwise.

excludeTrigger

public static void excludeTrigger(Trigger trigger,
                                  Transition trans,
                                  EObject contextHint)
Excludes the given trigger from this transition's contextual fragment

Parameters:
trigger - The trigger to exclude
contextHint - The redefinition context hint

unexcludeTrigger

public static void unexcludeTrigger(Trigger trigger,
                                    Transition trans,
                                    EObject contextHint)
Unexcludes (re-inherit) the given trigger from the transition's contextual fragment.

Parameters:
trigger -
trans -
redefinitionHint -

getKind

public static TransitionKind getKind(Transition fragment)
Parameters:
fragment - - any (redefining or not) Transition fragment
Returns:
TransitionKind value which is not redefinable and is always inherited from the root Transition fragment

setRedefinedTransition

public static void setRedefinedTransition(Transition redefining,
                                          Transition redefined)

UML Modeling Layer

© Copyright IBM Corp. 2009. All rights reserved.