/java-builder-generator

Python script that generates java code using the builder pattern

Primary LanguagePythonMIT LicenseMIT

java-builder-generator

Python script that generates java code using the builder pattern

To run the script

execute generator.py using python

python generator.py

Model

Currently model.py contains the OpenRTB 2.3 object.

Generating new models

Write a simple python dictonary like model.py. For data types you can use the primitives int, and double. You can add more via the util.py config script, in the datatypes var.

Also you can use composite data types like String, List<String>, List<Integer>.

Example model

package = 'example'
model = {
  'user' : {
      'name' : 'str',
      'surname' : 'str',
      'phone' : 'int',
      'age' : 'int',
      'luckynumbers' : 'int[]',
      'hobbies' : 'str[]'
    }
}

Generated code can be found in example dir.