The deduced framework comes with a code generator. It uses schema definitions to produce Java code that matches the defined property collection structure.
Generating code has the following advantages:
Generating code has the following disadvantage:
The command line generator is executed with the java class : org.deduced.generator.java.CommandLineJavaGenerator. It has the following options.
usage: javagenerator -d,--dependencies <FILES> List of dependent schema files required to generate the current schema. Use a list of file names separated by a semi-colon. The files have to be in order of dependency. Example : --dependencies="file1.xml;file2.xml" -h,--help Print this message. -i,--input <FILE> Input file name. This should point to a valid XML file that contains a deduced schema layer. Use quotes to enter file names with blank spaces. This option is mandatory. -o,--output <FOLDER> Output folder name where the generated files will be created. If the folder doesn't exist, the generator will create it. This option isn't mandatory. If it isn't specified, the output will be in the current folder. -x,--ignoreXmlLoadingErrors Ignore XML loading errors encountered while loading the input file or it's dependencies. Default setting is false.
For example, it can be invoked with the following pattern:
javagenerator --input custom-schema.xml --dependencies dependent-schema.xml;other-schema.xml --output target/generated
This will generate the files from custom-schema.xml and output it in the relative folder target/generated. Two files will also be loaded to resolve dependencies : dependent-schema.xml and other-schemal.xml.
The following example shows how to resolve files that contain spaces
javagenerator --input "custom schema.xml" --dependencies "dependent schema.xml;other schema.xml" --output target/generated
In order to define the schema, the generator user interface can be started with the java class : org.deduced.generator.ui.StartGeneratorApplication.
Steps to create a new schema: