public class ClassChanges extends MoMLFilterSimple
This class will filter moml for simple class changes where the context of the class name to be changed does not matter - all occurrences of the class name will be changed. This class can be thought of as a primitive form of sed.
If a class within an actor is what has changed, use (@see PropertyClassChanges) instead.
| Constructor and Description |
|---|
ClassChanges() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clear the map of class renames and the set of class removals.
|
java.lang.String |
filterAttributeValue(NamedObj container,
java.lang.String element,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String xmlFile)
If the attributeName is "class" and attributeValue names a
class that needs to be renamed, then substitute in the new class
name.
|
void |
filterEndElement(NamedObj container,
java.lang.String elementName,
java.lang.StringBuffer currentCharData,
java.lang.String xmlFile)
In this class, do nothing.
|
void |
put(java.lang.String oldName,
java.lang.String newName)
Add a class to be filtered.
|
void |
remove(java.lang.String className)
Remove a class to be filtered.
|
java.lang.String |
toString()
Return a string that describes what the filter does.
|
filterAttributeValue, filterEndElementpublic ClassChanges()
public static void clear()
public java.lang.String filterAttributeValue(NamedObj container, java.lang.String element, java.lang.String attributeName, java.lang.String attributeValue, java.lang.String xmlFile)
container - The container for this attribute.element - The XML element name.attributeName - The name of the attribute.attributeValue - The value of the attribute.xmlFile - The file currently being parsed.public void filterEndElement(NamedObj container, java.lang.String elementName, java.lang.StringBuffer currentCharData, java.lang.String xmlFile) throws java.lang.Exception
container - The object created by this element.elementName - The element name.currentCharData - The character data, which appears
only in the doc and configure elementsxmlFile - The file currently being parsed.java.lang.Exception - Not thrown in this base class.public void put(java.lang.String oldName, java.lang.String newName)
remove(String),
calling "new ClassChanges()" will not remove a class that was
added with this method.oldName - The old name of the class to be filtered.newName - The new name of the class to be filtered. If
the value is null, then the class in oldName will be removed.remove(String)public void remove(java.lang.String className)
className - The name of the class to be filtered
out, for example "ptolemy.copernicus.kernel.GeneratorAttribute".put(String, String)public java.lang.String toString()
toString in interface MoMLFiltertoString in class java.lang.Object