All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.cedarsoft.devtools.Module Maven / Gradle / Ivy

The newest version!
package eu.cedarsoft.devtools;

import eu.cedarsoft.utils.CmdLine;
import eu.cedarsoft.utils.Renderer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * A module that is accessable through the Developer Tools
 */
public interface Module {
  /**
   * Returns the description of the module
   *
   * @return the description
   */
  @NotNull
  String getDescription();

  /**
   * Process the module
   *
   * @param cmdLine the command line that is used
   * @throws Exception if an exception occures
   */
  void process( @NotNull CmdLine cmdLine ) throws Exception;

  /**
   * A special ModuleStringPresenter
   */
  class ModuleStringPresenter implements Renderer {
    @NotNull
    public String render( @NotNull Module object, @Nullable Object context ) {
      return object.getDescription();
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy