Class Scaffolder

java.lang.Object
io.github.josemodi97.sageactive4j.scaffold.Scaffolder

public final class Scaffolder extends Object
Writes the example files for a Framework. Shared, as source, by the Maven plugin and the standalone Gradle plugin build, so the two can't generate different code.
  • plain: sageactive4j/SageActiveExample.java, a main that prints the user profile and the first customers.
  • servlet / jakarta: sageactive4j/SageActiveServlet.java, browser sign-in at /sage/login and /sage/callback.
  • spring-boot2 / spring-boot3: sageactive4j/SageController.java (/sage/accounting/accounts, /sage/sales/invoice) plus sageactive4j.properties, which it loads.
Existing files are skipped unless force is set.
  • Field Details

  • Method Details

    • filesFor

      public static List<Scaffolder.GeneratedFile> filesFor(Framework framework, Path javaSourceDir, Path resourceDir, String generator)
      The files framework gets, rendered.
      Parameters:
      generator - how the user ran the generator, quoted in the file header (e.g. sageactive4j:init)
    • write

      public static List<Path> write(List<Scaffolder.GeneratedFile> files, boolean force, Scaffolder.Log log) throws IOException
      Writes files, skipping (and logging) any that exist unless force is set.
      Returns:
      the files actually written
      Throws:
      IOException
    • nextSteps

      public static List<String> nextSteps(Framework framework, String version, boolean artifactDeclared)
      What the user still has to do, one line per step.
      Parameters:
      version - the sageactive4j version to suggest, or null
      artifactDeclared - whether the project already declares the needed artifact