Class AbstractTaskClientGenerator

java.lang.Object
com.vaadin.flow.server.frontend.AbstractTaskClientGenerator
All Implemented Interfaces:
FallibleCommand
Direct Known Subclasses:
TaskGenerateBootstrap, TaskGenerateFeatureFlags, TaskGenerateIndexHtml, TaskGenerateIndexTs, TaskGenerateServiceWorker, TaskGenerateTsConfig, TaskGenerateTsDefinitions, TaskGenerateViteDevMode, TaskGenerateWebComponentBootstrap, TaskGenerateWebComponentHtml

public abstract class AbstractTaskClientGenerator extends Object implements FallibleCommand
Abstract class for generating client files.

For internal use only. May be renamed or removed in a future release.

Since:
3.0
  • Constructor Details

    • AbstractTaskClientGenerator

      public AbstractTaskClientGenerator()
  • Method Details

    • getFileContent

      protected abstract String getFileContent() throws IOException
      Get file content for writing to the generated file.
      Returns:
      content of the file.
      Throws:
      IOException - if IO error happens while reading file content.
    • getGeneratedFile

      protected abstract File getGeneratedFile()
      Get the generated file where content will be written.
      Returns:
      the generated file.
    • shouldGenerate

      protected abstract boolean shouldGenerate()
      Check if it should generate the file or not.
      Returns:
      true if it should generate, false otherwise.
    • execute

      public void execute() throws ExecutionFailedException
      Description copied from interface: FallibleCommand
      Runs the given command.

      If execution fails then the command may throw an exception which may give a message and a cause of the failure.

      Specified by:
      execute in interface FallibleCommand
      Throws:
      ExecutionFailedException - if there is an execution error