IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.uml2.cpp
Class CPPExtendEnumerationRule

java.lang.Object
  extended bycom.ibm.xtools.transform.core.AbstractTransformElement
      extended bycom.ibm.xtools.transform.core.AbstractRule
          extended bycom.ibm.xtools.transform.uml2.cpp.CPPExtendFramework
              extended bycom.ibm.xtools.transform.uml2.cpp.CPPExtendRule
                  extended bycom.ibm.xtools.transform.uml2.cpp.CPPExtendEnumerationRule
All Implemented Interfaces:
ITransformationItem

public abstract class CPPExtendEnumerationRule
extends CPPExtendRule

This class provides common functionality for the extensibility of the transformation of UML2 Enumerations into a C++ code. The source property of the rule context is expected to be a UML2 Enumeration.


Constructor Summary
CPPExtendEnumerationRule(String id)
          Constructor.
 
Method Summary
protected  boolean addAttribute(String name, String constantExpression, String comment, ITransformContext ruleContext)
          Adds enumeration attribute with the specified properties to the generated C++ enumeration.
 boolean canAccept(ITransformContext context)
          The implementation of this method filters out contexts with inappropriate source elements, then calls canAcceptExt to provide additional filtering capabilities.
protected  Enumeration getSourceEnumeration(ITransformContext context)
          Returns UML2 enumeration to be processed, if any.
 
Methods inherited from class com.ibm.xtools.transform.uml2.cpp.CPPExtendRule
addBodyPrefix, addBodySuffix, addHeaderPrefix, addHeaderSuffix, isNested
 
Methods inherited from class com.ibm.xtools.transform.uml2.cpp.CPPExtendFramework
canAcceptExt, createTarget, createTargetExt
 
Methods inherited from class com.ibm.xtools.transform.core.AbstractRule
execute, findTarget, isSourceConsumed, mapTarget, toString, updateTarget
 
Methods inherited from class com.ibm.xtools.transform.core.AbstractTransformElement
getAcceptCondition, getDescription, getId, getName, getProgressMonitor, setAcceptCondition, setDescription, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CPPExtendEnumerationRule

public CPPExtendEnumerationRule(String id)
Constructor.

Parameters:
id - A unique identifier for the rule.
Method Detail

canAccept

public boolean canAccept(ITransformContext context)
Description copied from class: CPPExtendFramework
The implementation of this method filters out contexts with inappropriate source elements, then calls canAcceptExt to provide additional filtering capabilities.

Overrides:
canAccept in class CPPExtendFramework
Parameters:
context - this rule execution context

addAttribute

protected final boolean addAttribute(String name,
                                     String constantExpression,
                                     String comment,
                                     ITransformContext ruleContext)
Adds enumeration attribute with the specified properties to the generated C++ enumeration.

Parameters:
name - The attribute's name.
constantExpression - The attribute's initializer expression.
comment - Comments to be added to the generated attribute. Set to null if this attribute has no comments.
ruleContext - This rule execution context. Must not be null.

getSourceEnumeration

protected final Enumeration getSourceEnumeration(ITransformContext context)
Returns UML2 enumeration to be processed, if any. May return null.

Parameters:
context - The rule execution context.
Returns:
The UML2 class to be processed or null.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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