Record Class JsonSchemaRecordsGeneration

java.lang.Object
java.lang.Record
io.micronaut.jsonschema.generator.records.JsonSchemaRecordsGeneration
Record Components:
jdbcUrl - JDBC URL
username - Database username
password - Database password
targetPackage - Target package for generated sources
languageLevel - Java language level used for generated Java sources
schemaCacheDir - Directory where discovered schemas are cached
outputDir - Directory where sources are generated
sources - Configured schema discovery sources
skipOnError - Whether per-object discovery and generation failures should be skipped
failOnMissingSource - Whether unavailable configured sources should fail the build
language - Generated source language

public record JsonSchemaRecordsGeneration(String jdbcUrl, String username, String password, String targetPackage, Integer languageLevel, File schemaCacheDir, File outputDir, List<Map<String,Object>> sources, Boolean skipOnError, Boolean failOnMissingSource, String language) extends Record
Shared build-plugin task definition for JSON Schema discovery and source generation.
Since:
2.2.0
  • Constructor Details

    • JsonSchemaRecordsGeneration

      public JsonSchemaRecordsGeneration(String jdbcUrl, String username, String password, String targetPackage, Integer languageLevel, File schemaCacheDir, File outputDir, List<Map<String,Object>> sources, Boolean skipOnError, Boolean failOnMissingSource)
      Create a Java generation task definition.
      Parameters:
      jdbcUrl - JDBC URL
      username - Database username
      password - Database password
      targetPackage - Target package for generated sources
      languageLevel - Java language level used for generated Java sources
      schemaCacheDir - Directory where discovered schemas are cached
      outputDir - Directory where sources are generated
      sources - Configured schema discovery sources
      skipOnError - Whether per-object discovery and generation failures should be skipped
      failOnMissingSource - Whether unavailable configured sources should fail the build
    • JsonSchemaRecordsGeneration

      public JsonSchemaRecordsGeneration(String jdbcUrl, String username, String password, String targetPackage, Integer languageLevel, File schemaCacheDir, File outputDir, List<Map<String,Object>> sources, Boolean skipOnError, Boolean failOnMissingSource, String language)
      Create a normalized generation task definition.
      Parameters:
      jdbcUrl - JDBC URL
      username - Database username
      password - Database password
      targetPackage - Target package for generated sources
      languageLevel - Java language level used for generated Java sources
      schemaCacheDir - Directory where discovered schemas are cached
      outputDir - Directory where sources are generated
      sources - Configured schema discovery sources
      skipOnError - Whether per-object discovery and generation failures should be skipped
      failOnMissingSource - Whether unavailable configured sources should fail the build
      language - Generated source language
  • Method Details

    • generate

      public void generate()
    • generate

      public void generate(JsonSchemaRecordsLogger logger, ClassLoader providerClassLoader) throws Exception
      Execute generation with build-tool-specific services.
      Parameters:
      logger - The logger to use
      providerClassLoader - The classloader used to resolve discovery providers
      Throws:
      Exception - If generation fails
    • toGeneratorConfig

      public JsonSchemaRecordsGeneratorConfig toGeneratorConfig()
      Convert this task definition to the generator configuration.
      Returns:
      The generator configuration
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • jdbcUrl

      public String jdbcUrl()
      Returns the value of the jdbcUrl record component.
      Returns:
      the value of the jdbcUrl record component
    • username

      public String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • password

      public String password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component
    • targetPackage

      public String targetPackage()
      Returns the value of the targetPackage record component.
      Returns:
      the value of the targetPackage record component
    • languageLevel

      public Integer languageLevel()
      Returns the value of the languageLevel record component.
      Returns:
      the value of the languageLevel record component
    • schemaCacheDir

      public File schemaCacheDir()
      Returns the value of the schemaCacheDir record component.
      Returns:
      the value of the schemaCacheDir record component
    • outputDir

      public File outputDir()
      Returns the value of the outputDir record component.
      Returns:
      the value of the outputDir record component
    • sources

      public List<Map<String,Object>> sources()
      Returns the value of the sources record component.
      Returns:
      the value of the sources record component
    • skipOnError

      public Boolean skipOnError()
      Returns the value of the skipOnError record component.
      Returns:
      the value of the skipOnError record component
    • failOnMissingSource

      public Boolean failOnMissingSource()
      Returns the value of the failOnMissingSource record component.
      Returns:
      the value of the failOnMissingSource record component
    • language

      public String language()
      Returns the value of the language record component.
      Returns:
      the value of the language record component