|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.moml.filter.ChangeFixedWidth1ToAuto
public class ChangeFixedWidth1ToAuto
When this class is registered with the MoMLParser.setMoMLFilter() method, it will cause MoMLParser to filter so that models from earlier releases will run in the current release. This class will filter for relations that have a fixed width of 1. The width value will be changed to AUto, which is the new default for width inference.
Red (rodiers) |
Red (rodiers) |
Field Summary | |
---|---|
private boolean |
madeModification
Keep track of modifications. |
Constructor Summary | |
---|---|
ChangeFixedWidth1ToAuto()
|
Method Summary | |
---|---|
private static void |
_updateFile(java.lang.String fileName)
Convert the model with name fileName. |
private static void |
_updateXMLFiles(java.io.File folder,
java.lang.String filter)
Convert the models in the folder. |
java.lang.String |
filterAttributeValue(NamedObj container,
java.lang.String element,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String xmlFile)
This method doesn't do anything. |
void |
filterEndElement(NamedObj container,
java.lang.String elementName,
java.lang.StringBuffer currentCharData,
java.lang.String xmlFile)
Filter relations widths and change 1 to "Auto" and make sure still value is not not stored (if not changed). |
static void |
main(java.lang.String[] args)
Main function. |
java.lang.String |
toString()
Return a string that describes what the filter does. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean madeModification
Constructor Detail |
---|
public ChangeFixedWidth1ToAuto()
Method Detail |
---|
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 for XML element.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
filterEndElement
in interface MoMLFilter
container
- The object defined by the element that this
is the end of.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
- If there is a problem modifying the
specified container.public static void main(java.lang.String[] args) throws java.lang.Exception
args
- The arguments of the main function.
java.lang.Exception
- If the model can't be converted.public java.lang.String toString()
toString
in interface MoMLFilter
toString
in class java.lang.Object
private static void _updateXMLFiles(java.io.File folder, java.lang.String filter)
folder
- The folder in which models need to be converted.filter
- If null, no filter will be applied. On models for which
the path contains "/" + filter + "/" are converted.private static void _updateFile(java.lang.String fileName) throws java.lang.Exception
fileName
- The name (and path) of the model
java.lang.Exception
- If the model can't be converted
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |