UML Modeling Layer

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

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.RedefClassifierUtil

public class RedefClassifierUtil
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
RedefClassifierUtil()
           
 
Method Summary
static boolean contains(EncapsulatedClassifier clazz, Port port)
           
static List getAllConnectors(StructuredClassifier context)
          Utility method to get the set of Inherited + Local - Redefined ports
protected static List getAllConnectors(StructuredClassifier context, Set visited, Set excluded)
          Local method to get the set of Inherited + Local - Redefined ports
static List getAllPorts(EncapsulatedClassifier context)
          Utility method to get the set of Inherited + Local - Redefined ports
protected static List getAllPorts(EncapsulatedClassifier context, Set visited, Set excluded)
          Local method to get the set of Inherited + Local - Redefined ports
static List getAllRoles(StructuredClassifier context)
          Utility method to get the set of Inherited + Local - Redefined roles
protected static List getAllRoles(StructuredClassifier context, Set visited, Set excluded)
          Local method
protected static List getInheritedConnectors(StructuredClassifier context, Set visited)
          Utility method for returning the set of inherited connectors for a given classifier
protected static List getInheritedPorts(EncapsulatedClassifier context, Set visited)
          Utility method for returning the set of inherited ports for a given classifier
protected static List getInheritedRoles(StructuredClassifier context, Set visited)
          Returns the list of inherited roles for the given context
static List getLocalConnectors(StructuredClassifier context)
          use it instead of calling context.getOwnedConnectors() directly
static List getLocalPorts(EncapsulatedClassifier context)
          use it instead of calling context.getOwnedPorts() directly
static List getLocalRoles(StructuredClassifier context)
          Use it instead of calling context.getRoles() directly
static boolean isLocal(StructuredClassifier context, Feature feature)
          Utility method - is the property local to the classifier (i.e. not inherited)
static void setRole(ConnectorEnd sourceConnectorEnd, ConnectableElement connectable)
          Sets the connector end reference taking redefinitions into account.
 
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

RedefClassifierUtil

public RedefClassifierUtil()
Method Detail

getInheritedRoles

protected static List getInheritedRoles(StructuredClassifier context,
                                        Set visited)
Returns the list of inherited roles for the given context

Parameters:
context - the classifier
Returns:
List of inherited roles or null

getAllRoles

protected static List getAllRoles(StructuredClassifier context,
                                  Set visited,
                                  Set excluded)
Local method

Parameters:
context - the classifier
visited - to avoid circular inheritance revisits
Returns:
List of inherited roles or null

getLocalRoles

public static List getLocalRoles(StructuredClassifier context)
Use it instead of calling context.getRoles() directly

Parameters:
context -
Returns:

getAllRoles

public static List getAllRoles(StructuredClassifier context)
Utility method to get the set of Inherited + Local - Redefined roles

Parameters:
context - class for which to get the set of roles
Returns:
list with roles (never null)

isLocal

public static boolean isLocal(StructuredClassifier context,
                              Feature feature)
Utility method - is the property local to the classifier (i.e. not inherited)

Parameters:
context -
p -
Returns:

getInheritedPorts

protected static List getInheritedPorts(EncapsulatedClassifier context,
                                        Set visited)
Utility method for returning the set of inherited ports for a given classifier

Parameters:
context - the classifier
Returns:
List of inherited ports or null

getAllPorts

protected static List getAllPorts(EncapsulatedClassifier context,
                                  Set visited,
                                  Set excluded)
Local method to get the set of Inherited + Local - Redefined ports

Parameters:
context - class for which to get the set of ports
Returns:
list with ports (never null)

getLocalPorts

public static List getLocalPorts(EncapsulatedClassifier context)
use it instead of calling context.getOwnedPorts() directly

Parameters:
context -
Returns:

getAllPorts

public static List getAllPorts(EncapsulatedClassifier context)
Utility method to get the set of Inherited + Local - Redefined ports

Parameters:
context - class for which to get the set of ports
Returns:
list with ports (never null)

getInheritedConnectors

protected static List getInheritedConnectors(StructuredClassifier context,
                                             Set visited)
Utility method for returning the set of inherited connectors for a given classifier

Parameters:
context - the classifier
Returns:
List of inherited connectors or null

getAllConnectors

protected static List getAllConnectors(StructuredClassifier context,
                                       Set visited,
                                       Set excluded)
Local method to get the set of Inherited + Local - Redefined ports

Parameters:
context - class for which to get the set of ports
Returns:
list with connectors (never null)

getLocalConnectors

public static List getLocalConnectors(StructuredClassifier context)
use it instead of calling context.getOwnedConnectors() directly

Parameters:
context -
Returns:

getAllConnectors

public static List getAllConnectors(StructuredClassifier context)
Utility method to get the set of Inherited + Local - Redefined ports

Parameters:
context - class for which to get the set of ports
Returns:
list with connectors (never null)

setRole

public static void setRole(ConnectorEnd sourceConnectorEnd,
                           ConnectableElement connectable)
Sets the connector end reference taking redefinitions into account. The client should call this method instead of ConnectorEnd.setRole(ConnectableElement)

Parameters:
sourceConnectorEnd -
connectable -

contains

public static boolean contains(EncapsulatedClassifier clazz,
                               Port port)
Parameters:
clazz -
port -
Returns:
a flag indicating if the generalization chain of the given classifier contains the given port

UML Modeling Layer

© Copyright IBM Corp. 2009. All rights reserved.