Class LegacyXmlExporter
java.lang.Object
legacyxml.LegacyXmlExporter
Rewrites a JMT XML file (any tool that stores
classPath attributes: .jsimg,
.jsimw, simulation input) between XmlFormats. Command line:
java -cp jmt-legacy-xml.jar legacyxml.LegacyXmlExporter in.jsimg out.jsimg [version]
where version defaults to 1.4.0.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidRewrites everyclassPathattribute of the document in place.static StringconvertClassName(String name, XmlFormat target) Maps one class name to the requested format; names it does not recognise (java.*, already converted) are returned as is.static voidReadsin(any format), writesoutintargetformat.static FilelegacyFileFor(File current) File the legacy copy ofcurrentis written to:model.jsimgbecomesmodel.legacy.jsimg.static voidstatic FilesaveLegacyCopy(Document current, File currentFile) Writes theXmlFormat.V1_4_0copy of a document that was just saved ascurrentFile.
-
Method Details
-
export
-
convert
Rewrites everyclassPathattribute of the document in place. ForXmlFormat.V1_4_0thejmtVersionroot attribute is also removed (older schemas reject unknown attributes) and its value is kept in a leading comment. -
convertClassName
-
legacyFileFor
-
saveLegacyCopy
Writes theXmlFormat.V1_4_0copy of a document that was just saved ascurrentFile. Works on a copy, socurrentkeeps the current format. Never throws: the legacy copy is a courtesy and must not fail the real save.- Returns:
- the legacy file, or null if it could not be written
-
main
-