|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.backtrack.ui.BacktrackTransformer.RenameClassMoMLFilter
private static class BacktrackTransformer.RenameClassMoMLFilter
The MoML filter that renames the actor classes in the model, if there are backtracking versions for them. No change is done on the actor classes that do not have backtracking versions.
Red (tfeng) |
Red (tfeng) |
Field Summary | |
---|---|
private java.util.Stack<java.lang.String> |
_classStack
The stack of the name of the classes that have been changed. |
private java.util.List<NamedObj> |
_entitiesChanged
The list of entities changed during the parsing. |
private MoMLParser |
_parser
The parser to parse extra content (e.g., icon MoML). |
static java.lang.String |
AUTOMATIC_PREFIX
The prefix to the automatically generated backtracking version of actors. |
static java.lang.String |
MANUAL_PREFIX
The prefix to the manually written backtracking version of actors. |
Constructor Summary | |
---|---|
private |
BacktrackTransformer.RenameClassMoMLFilter()
|
Method Summary | |
---|---|
private static boolean |
_classExists(java.lang.String className)
Test whether a class with the given name can be found. |
private void |
_copyIcon(NamedObj container)
Copy the icon of the last modified class (of a Ptolemy actor) to the MoML within the container's context. |
private static java.lang.String |
_newClassName(java.lang.String oldClassName)
Get the new name for class to be changed to its backtracking version. |
private NamedObj |
_parse(java.io.Reader reader,
java.lang.String systemID,
NamedObj container)
Parse the content in the reader within the context of the container. |
java.util.Iterator<NamedObj> |
entitiesChanged()
Return the entities that are changed during the last XML parsing. |
java.lang.String |
filterAttributeValue(NamedObj container,
java.lang.String element,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String xmlFile)
Filter the value of the attribute. |
void |
filterEndElement(NamedObj container,
java.lang.String elementName,
java.lang.StringBuffer currentCharData,
java.lang.String xmlFile)
Further process the XML element when it is closed with an end tag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ptolemy.moml.MoMLFilter |
---|
toString |
Field Detail |
---|
public static final java.lang.String AUTOMATIC_PREFIX
public static final java.lang.String MANUAL_PREFIX
private java.util.Stack<java.lang.String> _classStack
private java.util.List<NamedObj> _entitiesChanged
private MoMLParser _parser
Constructor Detail |
---|
private BacktrackTransformer.RenameClassMoMLFilter()
Method Detail |
---|
public java.util.Iterator<NamedObj> entitiesChanged()
public java.lang.String filterAttributeValue(NamedObj container, java.lang.String element, java.lang.String attributeName, java.lang.String attributeValue, java.lang.String xmlFile)
filterAttributeValue
in interface MoMLFilter
container
- The container of the attribute.element
- The XML element.attributeName
- The attribute name.attributeValue
- The attribute value.xmlFile
- The file currently being parsed.
public void filterEndElement(NamedObj container, java.lang.String elementName, java.lang.StringBuffer currentCharData, java.lang.String xmlFile) throws IllegalActionException
filterEndElement
in interface MoMLFilter
container
- The container of the element.elementName
- The XML element to be closed.currentCharData
- The character data, which appears
only in the doc and configure elementsxmlFile
- The file currently being parsed.
IllegalActionException
- If the MoML of the original
actor's icon cannot be read and inserted into the new model.private static boolean _classExists(java.lang.String className)
className
- The name of the class.
private void _copyIcon(NamedObj container) throws IllegalActionException
container
- The container.
IllegalActionException
- If the parsing is not successful.private static java.lang.String _newClassName(java.lang.String oldClassName)
oldClassName
- The name of the class before change.
private NamedObj _parse(java.io.Reader reader, java.lang.String systemID, NamedObj container) throws java.lang.Exception
reader
- The reader to be read from.container
- The context of the parsing.
java.lang.Exception
- If the parsing is not successful.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |