Class AbstractGenerator

java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.core.AbstractGenerator
All Implemented Interfaces:
Generator, ResourceProvider
Direct Known Subclasses:
ClasspathScanner, EclipseConfigurator, JarGenerator, JavaTool, MvnPublisher, PomFileGenerator, ResourceCollector, VscodeConfigurator

public abstract class AbstractGenerator extends AbstractProvider implements Generator
A base implementation of a Generator.
  • Constructor Details

    • AbstractGenerator

      public AbstractGenerator(Project project)
      Instantiates a new abstract generator.
      Parameters:
      project - the project
  • Method Details

    • name

      public AbstractGenerator name(String name)
      Sets the name of the generator.
      Parameters:
      name - the name
      Returns:
      the generator
    • name

      public String name()
      Name.
      Specified by:
      name in interface Generator
      Returns:
      the string
    • project

      public final Project project()
      Project.
      Specified by:
      project in interface Generator
      Returns:
      the project
    • newResource

      protected <T extends Resource> T newResource(ResourceType<T> type, Object... args)
      Short for project().newResource(type, args).
      Type Parameters:
      T - the generic type
      Parameters:
      type - the type
      args - the args
      Returns:
      the t
    • cleanup

      protected boolean cleanup(ResourceRequest<?> requested, Path... files)
      If the request includes Cleanliness deletes the given files and returns true.
      Parameters:
      requested - the requested resource
      files - the files
      Returns:
      true, if successful
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class AbstractProvider
      Returns:
      the string