Class GenerateEnumerations
java.lang.Object
edu.nps.moves.dis7.source.generator.enumerations.GenerateEnumerations
GenerateEnumerations creates source code from SISO enumeration definitions.
Created on Apr 16, 2019 by MOVES Institute, Naval Postgraduate School (NPS), Monterey California USA https://www.nps.edu
- Version:
- $Id$
- Author:
- Don McGregor, Mike Bailey and Don Brutzman
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassXML handler for recursively reading information and autogenerating code, namely an inner class that handles the SAX parsing of the XML file.classUtility class -
Constructor Summary
ConstructorsConstructorDescriptionGenerateEnumerations(String xmlFile, String outputDir, String packageName) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringReplace special characters in name with underscore _ characterstatic final Stringcleanup special characters in stringstatic voidCommand-line or solo invocation to run this objectstatic StringnormalizeDescription(String value) Normalize string characters to create valid descriptionstatic StringnormalizeToken(String value) Normalize string characters to create valid Java name.
-
Constructor Details
-
GenerateEnumerations
Constructor- Parameters:
xmlFile- input sisoXmlFileoutputDir- output directory pathpackageName- package name for this set of enumerations
-
-
Method Details
-
fixName
Replace special characters in name with underscore _ character- Parameters:
name- name value (typically from XML)- Returns:
- normalized name
-
htmlize
cleanup special characters in string- Parameters:
s- input string- Returns:
- output string
-
main
Command-line or solo invocation to run this object- Parameters:
args- three configuration arguments, if defaults not used
-
normalizeDescription
Normalize string characters to create valid description- Parameters:
value- of interest- Returns:
- normalized value
-
normalizeToken
Normalize string characters to create valid Java name. Note that unmangled name typically remains available in the description- Parameters:
value- of interest- Returns:
- normalized value
-