Class ParameterReplacementContributor

java.lang.Object
ch.admin.bit.jeap.initializer.contributor.ParameterReplacementContributor
All Implemented Interfaces:
ProjectContributor, org.springframework.core.Ordered

@Component public class ParameterReplacementContributor extends Object implements ProjectContributor
Project contributor that replaces parameters in source files.

Parameters are defined in the source files with the following pattern: INITIALIZER PARAMETER <parameter-name> VALUE <parameter-value>

The parameter definition can be prefixed/postfixed with any string (ex. //, # or <!--).

Lines with parameter definitions are removed from the source files and the parameters are replaced with their values.

  • Constructor Details

    • ParameterReplacementContributor

      public ParameterReplacementContributor(JeapInitializerProperties jeapInitializerProperties)
  • Method Details

    • contribute

      public void contribute(Path projectRoot, ProjectRequest projectRequest, ProjectTemplate template) throws IOException
      Description copied from interface: ProjectContributor
      This method will be called after the initial code has been checked out from Git. Your custom logic has to be implemented here and should do the required changes to files and folders under 'projectRoot'

      The ordering of execution can be set by overriding the getOrder() method.

      Specified by:
      contribute in interface ProjectContributor
      Parameters:
      projectRoot - a Path containing the root project folder
      projectRequest - the project request containing the input data
      template - the project template
      Throws:
      IOException