|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.kernel.util.SingletonAttribute
ptolemy.copernicus.kernel.GeneratorAttribute
public class GeneratorAttribute
This is an attribute that stores the configuration of a code generator.
The initial default parameters, their values and their documentation are read in from a MoML file specified by the initialParametersURL. Having the parameters defined in a MoML file allows us to easily add and modify parameters without lots of bookkeeping.
To view the initial default parameters, either call toString(), or run:
java -classpath $PTII ptolemy.copernicus.kernel.Copernicus -help
| Red (johnr) |
| Red (eal) |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
|---|
NamedObj.ContainedObjectsIterator |
| Field Summary | |
|---|---|
StringParameter |
initialParametersURL
MoML file that contains other parameters. |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
|---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Constructor Summary | |
|---|---|
GeneratorAttribute(NamedObj container,
java.lang.String name)
Construct an attribute with the given name contained by the specified entity. |
|
| Method Summary | |
|---|---|
void |
changeExecuted(ChangeRequest change)
React to a change request has been successfully executed. |
void |
changeFailed(ChangeRequest change,
java.lang.Exception exception)
React to a change request has resulted in an exception. |
java.lang.String |
getParameter(java.lang.String name)
Get the string for the argument with the given name from this GeneratorAttribute. |
boolean |
hasParameter(java.lang.String name)
Return true if a parameter with the given name is defined in this GeneratorAttribute. |
void |
initialize()
If this GeneratorAttribute has not yet been initialized, the initialized it by reading the moml file named by the initialParametersURL and creating Parameters and Variables accordingly. |
static java.lang.String |
lookupClassAsResource(java.lang.String necessaryClass)
Deprecated. Call ptolemy.util.ClassUtilities.lookupClassAsResource() instead; |
void |
sanityCheckAndUpdateParameters(java.lang.String modelPathOrURL)
|
void |
setParameter(java.lang.String name,
java.lang.String value)
Set the string for the argument with the given name from this GeneratorAttribute to be the given value. |
java.lang.String |
toString()
Return a String representation of this object. |
void |
updateModelAttributes(java.lang.String modelPathOrURL)
Update the modelPath, modelName and iterations parameters in the GeneratorAttribute. |
| Methods inherited from class ptolemy.kernel.util.SingletonAttribute |
|---|
setContainer |
| Methods inherited from class ptolemy.kernel.util.Attribute |
|---|
_getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public StringParameter initialParametersURL
| Constructor Detail |
|---|
public GeneratorAttribute(NamedObj container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container.name - The name of this attribute.
IllegalActionException - If the attribute is not of an
acceptable class for the container, or if the name contains a period.
NameDuplicationException - If the name coincides with
an attribute already in the container.| Method Detail |
|---|
public void changeExecuted(ChangeRequest change)
ChangeListener
changeExecuted in interface ChangeListenerchange - The change that has been executed, or null if
the change was not done via a ChangeRequest.
public void changeFailed(ChangeRequest change,
java.lang.Exception exception)
ChangeListener
changeFailed in interface ChangeListenerchange - The change that was attempted or null if
the change was not done via a ChangeRequest.exception - The exception that resulted.
public java.lang.String getParameter(java.lang.String name)
throws IllegalActionException
IllegalActionException - If no Settable object with
the given name exists in this GeneratorAttribute.
public boolean hasParameter(java.lang.String name)
throws IllegalActionException
IllegalActionException
public void initialize()
throws IllegalActionException,
NameDuplicationException
IllegalActionException
NameDuplicationExceptionpublic static java.lang.String lookupClassAsResource(java.lang.String necessaryClass)
necessaryClass - The dot separated class name, for example
"ptolemy.kernel.util.NamedObj"
public void sanityCheckAndUpdateParameters(java.lang.String modelPathOrURL)
throws IllegalActionException,
NameDuplicationException
IllegalActionException
NameDuplicationException
public void setParameter(java.lang.String name,
java.lang.String value)
throws IllegalActionException
IllegalActionException - If no Settable object with
the given name exists in this GeneratorAttribute.public java.lang.String toString()
toString in class NamedObj
public void updateModelAttributes(java.lang.String modelPathOrURL)
throws IllegalActionException
modelPathOrURL - The file pathname or URL to the model.
IllegalActionException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||