IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework.uml2.adapters
Class Class

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.uml2.adapters.AbstractElement
      extended bycom.ibm.xtools.patterns.framework.uml2.adapters.Classifier
          extended bycom.ibm.xtools.patterns.framework.uml2.adapters.Class

public class Class
extends com.ibm.xtools.patterns.framework.uml2.adapters.Classifier

This UML2 adapter class for UML2 class. Contains many helper methods that together form a new interface for pattern instances to use (instead of the normal UML2 class methods that are exposed). Some of the same type of helper methods that are found in a model facade would be found here but distributed amongst the responsible metaclasses. For example, Class will wrap UML2 class.


Method Summary
 Association ensureDirectedAssociation(String roleName, Classifier associatedClassifier, AggregationKind aggregationKind, int multiplicityLowerBound, int multiplicityUpperBound)
          Ensure a directed association exists going from this class to the given associated classifier.
 Association ensureDirectedAssociation(String roleName1, Classifier associatedClassifier, String roleName2)
          Ensure a directed association exists going from this class to the given associated classifier.
 Operation ensureOperation(String name)
          Ensure an operation exists with the given name on this class.
 Operation ensureOperation(String name, VisibilityKind visibilityKind)
          Ensure an operation exists with the given name and visibility kind on this class.
 Operation ensureOperation(String name, VisibilityKind visibilityKind, boolean isStatic)
          Ensure an operation exists with the given name, visibility kind and static property.
 Association ensureSharedAggregateAssociation(String roleName1, Classifier ownedClassifier, String roleName2)
          Ensure a shared aggregation assocation exists between this class and the owned classifier.
 Property ensureStaticAttribute(String name, Type type)
          Ensure a static attribute on this class.
 Property ensureStaticAttribute(String name, Type type, VisibilityKind visibilityKind)
          Ensure a static attribute exists on this class with the given name, type and visibility kind.
 Operation ensureStaticOperation(String name)
          Ensure a static operation exists on this class.
 Operation ensureStaticOperation(String name, VisibilityKind visibilityKind)
          Ensures a static operation exists on this class.
 Usage ensureUsageRelationship(Classifier usedClassifier)
          Ensures a usage relationship exists between this class and the used classifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ensureDirectedAssociation

public Association ensureDirectedAssociation(String roleName1,
                                             Classifier associatedClassifier,
                                             String roleName2)
Ensure a directed association exists going from this class to the given associated classifier.

Parameters:
roleName1 - the role name on one end of the association
associatedClassifier - the classifier that the associated is directed towards
roleName2 - the role name on the classifier end of the association
Returns:
the ensured directed association

ensureDirectedAssociation

public Association ensureDirectedAssociation(String roleName,
                                             Classifier associatedClassifier,
                                             AggregationKind aggregationKind,
                                             int multiplicityLowerBound,
                                             int multiplicityUpperBound)
Ensure a directed association exists going from this class to the given associated classifier.

Parameters:
associatedClassifier - the classifier that the associated is directed towards
roleName - the role name of the associated classifier
aggregationKind - the kind of aggregation on the associated classifier end
multiplicityLowerBound - the lower bound of the multiplicity
multiplicityUpperBound - the upper bound of the multiplicity
Returns:
the ensured directed association

ensureOperation

public Operation ensureOperation(String name)
Ensure an operation exists with the given name on this class.

Parameters:
name - the name of the operation
Returns:
the ensured operation

ensureOperation

public Operation ensureOperation(String name,
                                 VisibilityKind visibilityKind)
Ensure an operation exists with the given name and visibility kind on this class.

Parameters:
name - the name of the operation
visibilityKind - the visibility kind for the operation, private, public, etc
Returns:
the ensured operation

ensureOperation

public Operation ensureOperation(String name,
                                 VisibilityKind visibilityKind,
                                 boolean isStatic)
Ensure an operation exists with the given name, visibility kind and static property.

Parameters:
name - the name of the operation
visibilityKind - the visibility kind of the operation
isStatic - the static property of this operation
Returns:
the ensured operation

ensureSharedAggregateAssociation

public Association ensureSharedAggregateAssociation(String roleName1,
                                                    Classifier ownedClassifier,
                                                    String roleName2)
Ensure a shared aggregation assocation exists between this class and the owned classifier.

Parameters:
roleName1 - the role name for this class's end of the association
ownedClassifier - the classifier aggregated by this class
roleName2 - the role name for the owned classifier end
Returns:
the ensured shared aggregate association

ensureStaticAttribute

public Property ensureStaticAttribute(String name,
                                      Type type)
Ensure a static attribute on this class.

Parameters:
name - the name of the static attribute
type - the type of the static attribute, a UML2 model element
Returns:
the ensured static attribute

ensureStaticAttribute

public Property ensureStaticAttribute(String name,
                                      Type type,
                                      VisibilityKind visibilityKind)
Ensure a static attribute exists on this class with the given name, type and visibility kind.

Parameters:
name - the name of the static attribute
type - the type of the static attribute, a UML2 model element
visibilityKind - the visibility kind of the attribute, public, private, etc
Returns:
the ensured static attribute with the given name, type, and visibility kind

ensureStaticOperation

public Operation ensureStaticOperation(String name)
Ensure a static operation exists on this class.

Parameters:
name - the name of the static operation that must exist
Returns:
the ensured static operation

ensureStaticOperation

public Operation ensureStaticOperation(String name,
                                       VisibilityKind visibilityKind)
Ensures a static operation exists on this class.

Parameters:
name - the name of the static operation that must exist
visibilityKind - the visibility kind of this operation, public, private, etc
Returns:
the ensured static operation

ensureUsageRelationship

public Usage ensureUsageRelationship(Classifier usedClassifier)
Ensures a usage relationship exists between this class and the used classifier.

Parameters:
usedClassifier - the classifier to be used by this class, a usage dependency relationship will be ensured
Returns:
the ensured usage relationship

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.