|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.domains.ptinyos.util.nc2moml.MoMLLib
public class MoMLLib
Traverse a directory tree and generate .moml files. Search the directory tree for files that input suffix (e.g., *.moml) and create files with the name output filename (e.g., index.moml) in each directory that contains an file with the input suffix and in all the parent directories. Existing input suffix files are overwritten.
Usage:
java -classpath $PTII:$PTII/ptolemy/domains/ptinyos/lib/jdom.jar \ ptolemy.domains.ptinyos.util.nc2moml.MoMLLib \ input suffix top-level output filename \ output filename root dir of input files
Example:
java -classpath $PTII:$PTII/ptolemy/domains/ptinyos/lib/jdom.jar \ ptolemy.domains.ptinyos.util.nc2moml.MoMLLib \ .moml _TOSIndex.moml _index.moml $PTII/vendors/ptinyos/moml
Red (celaine) |
Red (celaine) |
Constructor Summary | |
---|---|
MoMLLib()
|
Method Summary | |
---|---|
static void |
generateIndex(java.lang.String[] components,
java.lang.String[] indexFiles,
java.lang.String libraryName,
java.lang.String outputFile)
Generate the .moml index file for the given arguments. |
static void |
main(java.lang.String[] args)
Traverse the directory tree and generate .moml files. |
static void |
proc(java.lang.String inputSuffix,
java.lang.String indexFilename,
java.lang.String indexFilenameTopLevel,
boolean toplevel,
java.lang.String root,
java.lang.String currentDir)
Traverse the directory tree recursively and generate .moml index files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MoMLLib()
Method Detail |
---|
public static void generateIndex(java.lang.String[] components, java.lang.String[] indexFiles, java.lang.String libraryName, java.lang.String outputFile) throws java.io.IOException
<?xml version="1.0"?> <!DOCTYPE plot PUBLIC "-//UC Berkeley//DTD MoML 1//EN" "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd"> <!--DO NOT EDIT. This file was generated by ptolemy.domains.ptinyos.util.nc2moml.MoMLLib. The filename was chosen so that it does not conflict with .nc files of the same name and any other ptII-referenced .moml file in the classpath.--> <entity name="Counters" class="ptolemy.moml.EntityLibrary"> <configure> <?moml <group> <entity name="Counter" class="tos.lib.Counters.Counter" /> <entity name="IntToLeds" class="tos.lib.Counters.IntToLeds" /> <entity name="IntToLedsM" class="tos.lib.Counters.IntToLedsM" /> <entity name="IntToRfm" class="tos.lib.Counters.IntToRfm" /> <entity name="IntToRfmM" class="tos.lib.Counters.IntToRfmM" /> <entity name="RfmToInt" class="tos.lib.Counters.RfmToInt" /> <entity name="RfmToIntM" class="tos.lib.Counters.RfmToIntM" /> <entity name="SenseToInt" class="tos.lib.Counters.SenseToInt" /> </group> ?> </configure> </entity>
components
- Array containing the components in short
path format relative to the root.
Example: tos/lib/Counters/CounterlibraryName
- Name of this directory.indexFiles
- Array containing the sub-index files in
short path format relative to the outputFile directory.
Example: subdir/_TOSIndex.momloutputFile
- The file to generate in long path format.
Example: /home/celaine/ptII/vendors/ptinyos/moml/tos/lib/Counters/Counter/index.moml
java.io.IOException
- If there is a problem writing files.public static void main(java.lang.String[] args)
args
- An array of Strings.
public static void proc(java.lang.String inputSuffix, java.lang.String indexFilename, java.lang.String indexFilenameTopLevel, boolean toplevel, java.lang.String root, java.lang.String currentDir) throws java.lang.Exception
inputSuffix
- Suffix for the input files to look for.indexFilename
- Name of the index file to look for and
generate for non-top level.indexFilenameTopLevel
- Name of the top-level index file
to generate.toplevel
- True if this is the top-level call to proc().root
- Root dir of the input files.currentDir
- The current directory in this call to proc().
java.lang.Exception
- If internal error (duplicate file found
or invalid currentDir name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |