Class GenerateSchemaFromRecord

java.lang.Object
com.northconcepts.datapipeline.foundations.tools.GenerateSchemaFromRecord

public class GenerateSchemaFromRecord extends Object
A utility class for generating SchemaDef code from a Record or JSON object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GenerateSchemaFromRecord(String schemaName, String rootEntityName, Record rootRecord, File baseFolder, String targetPackage)
    Creates a generator that builds the schema from rootRecord; baseFolder and targetPackage are not used.
  • Method Summary

    Modifier and Type
    Method
    Description
    Builds an entity from the root record and one per nested record field, inferring boolean, numeric and date types from text values, and returns the schema.
    static void
    main(String... args)
    Prints, as XML, the schema generated from the JSON file passed as the only argument.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GenerateSchemaFromRecord

      public GenerateSchemaFromRecord(String schemaName, String rootEntityName, Record rootRecord, File baseFolder, String targetPackage)
      Creates a generator that builds the schema from rootRecord; baseFolder and targetPackage are not used.
  • Method Details

    • main

      public static void main(String... args)
      Prints, as XML, the schema generated from the JSON file passed as the only argument.
    • generate

      public SchemaDef generate()
      Builds an entity from the root record and one per nested record field, inferring boolean, numeric and date types from text values, and returns the schema.