public abstract class CodeGeneratorAdapter extends NamedObj
Subclasses should override generateFireCode(), generateInitializeCode() generatePostfireCode(), generatePreinitializeCode(), and generateWrapupCode() methods by appending a corresponding code block.
Subclasses should be sure to properly indent the code by
either using the code block functionality in methods like
_generateBlockCode(String) or by calling
CodeStream.indent(String)
,
for example:
StringBuffer code = new StringBuffer(); code.append(super.generateWrapupCode()); code.append("// Local wrapup code"); return processCode(CodeStream.indent(code.toString()));
Red (rodiers) |
Red (rodiers) |
NamedObj.ContainedObjectsIterator
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
CodeGeneratorAdapter() |
Modifier and Type | Method and Description |
---|---|
DecoratorAttributes |
createDecoratorAttributes(NamedObj target,
GenericCodeGenerator genericCodeGenerator)
Create and return the decorated attributes for the corresponding Ptolemy Component.
|
static java.lang.String |
generateName(NamedObj namedObj)
Generate sanitized name for the given named object.
|
abstract GenericCodeGenerator |
getCodeGenerator()
Get the code generator associated with this adapter class.
|
abstract void |
setCodeGenerator(GenericCodeGenerator codeGenerator)
Set the code generator associated with this adapter class.
|
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateExistence, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getContainer, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
public DecoratorAttributes createDecoratorAttributes(NamedObj target, GenericCodeGenerator genericCodeGenerator)
target
- The NamedObj that will be decorated.genericCodeGenerator
- The code generator that is the decorator for the
corresponding Ptolemy Component.public static java.lang.String generateName(NamedObj namedObj)
namedObj
- The named object for which the name is generated.public abstract GenericCodeGenerator getCodeGenerator()
setCodeGenerator(GenericCodeGenerator)
public abstract void setCodeGenerator(GenericCodeGenerator codeGenerator)
codeGenerator
- The code generator associated with this
adapter class.getCodeGenerator()