Menu

GeneratorFeature

Walter Lyrer

Strategy/State Generator Features

There are some features to mention with the Strategy/State Generator:

  1. Way of strategy integration

    • The generated code can have one of two ways of integration you can choose from:
      • SINGLETON_BY_PATTERN: Converter classes are generated following the Singleton Pattern.
      • SINGLETON_BY_SPRING_DI_ON_ANNOTATION: Converter classes are generated using Spring Dependency Injection with annotations @Component and @Autowired
  2. Generation of test classes

    • For each strategy a test class can be generated depending on the TestingFramework you choose.
      • TESTNG_6_8: TestNG version 6.8
      • JUNIT_4: JUnit version 4
      • NONE: No test classes are created
  3. Queryable result object

    • Each generation method returns a result object. The result object contains information which classes are created and which not (due to already existing files or program error).
  4. Executable class with main method:

    • Class ExecuteGenerator provides a main method to call the Strategy/State Generator. It can be called in three ways:
      1. Pass properties file paths as arguments:
        • args[0] (mandatory): File path of the properties file containing the data for the Global Properties.
        • args[1..n] (mandatory): File path of a properties file containing data for the Generation Properties
      2. Pass directory path containing properties files:
        • args[0]: File path of the directory containing the properties files
        • At least one properties file with name Global.properties containing the Global Properties is mandatory.
        • Please note, that no subdirectories are traversed to find properties files.
        • All other properties files are interpreted as Generation Propertied.
      3. Pass properties classpath files as arguments:
        • args[0] (mandatory): Resource classpath of the properties file containing the data for the Global Properties.
        • args[1..n] (mandatory): Resource classpath of a properties file containing data for the Generation Properties
  5. The NullStrategy generation can be disabled as property disableNullStrategy in class GeneratorIn.

  6. You can disable the generation of the business name as part of the class name by using property disableConditionNameInClassName in class GeneratorIn.

Copyright

Copyright by Walter Lyrer

Disclaimer

The author cannot be made responsible for any damage caused by the Strategy/State Generator.
The usage of the Strategy/State Generator is on own risk.
The code is designed and implemented on best know-how and with good intentions by the author.
Especially is to mention that the generated code of the Strategy/State Generator is not guaranteed to run instantly correct.
Manual supervision is necessary.

Author

Walter Lyrer

Other projects from same author

Jacoge Java Generator Eclipse Plugin
Converter Generator
Visitor Generator
Named Parameter Converter

Project Members: