Class JavascriptGenerator
java.lang.Object
edu.nps.moves.dis7.source.generator.pdus.AbstractGenerator
edu.nps.moves.dis7.source.generator.pdus.JavascriptGenerator
Generates JavaScript source files that marshal and unmarshal to IEEE DIS.
- Author:
- DMcG
-
Field Summary
Fields inherited from class edu.nps.moves.dis7.source.generator.pdus.AbstractGenerator
classDescriptions, generatedSourceDirectoryName, languageProperties
-
Constructor Summary
ConstructorsConstructorDescriptionJavascriptGenerator
(Map<String, GeneratedClass> pClassDescriptions, Properties pJavascriptProperties) Given the input object, something of an abstract syntax tree, this generates a source code file in the JavaScript language.It has ivars, getters, setters, and serialization/deserialization methods.Warning: only partially implemented. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Generate the classes and write them to a directoryvoid
writeFlagMethods
(PrintWriter pw, GeneratedClass aClass) Some fields have integers with bit fields defined, eg an integer where bits 0-2 represent some value, while bits 3-4 represent another value, and so on.Methods inherited from class edu.nps.moves.dis7.source.generator.pdus.AbstractGenerator
createGeneratedSourceDirectory, getBitsToShift, getGeneratedSourceDirectoryName, initialCapital, initialLower, setGeneratedSourceDirectoryName
-
Constructor Details
-
JavascriptGenerator
public JavascriptGenerator(Map<String, GeneratedClass> pClassDescriptions, Properties pJavascriptProperties) Given the input object, something of an abstract syntax tree, this generates a source code file in the JavaScript language.It has ivars, getters, setters, and serialization/deserialization methods.Warning: only partially implemented.- Parameters:
pClassDescriptions
- String Map of classespJavascriptProperties
- special language properties
-
-
Method Details
-
writeClasses
public void writeClasses()Generate the classes and write them to a directory- Specified by:
writeClasses
in classAbstractGenerator
-
writeFlagMethods
Some fields have integers with bit fields defined, eg an integer where bits 0-2 represent some value, while bits 3-4 represent another value, and so on. This writes accessor and mutator methods for those fields.- Parameters:
pw
- PrintWriteraClass
- of interest of interest
-