Main { public static void main(String args[]) throws Exception {{ // ********************************************************************* // Check the input arguments // ********************************************************************* String usage = "Usage: java Main XSD-filename Output-cd-filename Output-beh-filename [Output-code-type(DJ/DemeterJ)]"; if ((args.length < 3) || (args.length > 4)) { System.out.println(usage); System.exit(1); } String xsdFileName = args[0]; String cdFileName = args[1]; String behFileName = args[2]; String behCodeType = "DJ"; if (args.length > 3) { if (args[3].equalsIgnoreCase("DJ")) behCodeType = "DJ"; else if (args[3].equalsIgnoreCase("DemeterJ")) behCodeType = "DEMETERJ"; else { System.out.println("Invalid output-code-type: expected DJ or DemeterJ"); System.out.println(usage); System.exit(1); } } // ********************************************************************* // Parse the specified schema-definition file to extract the definitions // ********************************************************************* ClassGraph cg = new ClassGraph(true, false); CDDef def = Schema.readDefinition(cg, xsdFileName); // ********************************************************************* // Traverse the definition to create the equivalent cd file (to // represent the object structure) and beh file (to implement the // constraints) // ********************************************************************* def.generateOutputFiles(cg, cdFileName, behFileName, behCodeType); }} }