Interface Editor

All Known Implementing Classes:
DefaultEditor, FingerprintingEditor

public interface Editor
API for simple edition of text files like docker files.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    after(String line, org.gradle.api.Action<? super Editor> action)
    Restricts edition to lines after the given line.
    void
    before(String line, org.gradle.api.Action<? super Editor> action)
    Restricts edition to lines before the given line.
    void
    insert(String... lines)
    Inserts the provided lines after the current lower bound.
    void
    replace(String replacement)
    Replaces lines matching the current lower and upper bounds with the provided replacement.
    void
    replace(String line, String replacement)
    Replaces lines matching the current lower and upper bounds with the replacement, if they match the line pattern.
    void
    replaceRegex(String regex, String replacement)
    Replaces strings matching the current lower and upper bounds with the replacement, if they match the line pattern.
  • Method Details

    • after

      void after(String line, org.gradle.api.Action<? super Editor> action)
      Restricts edition to lines after the given line.
      Parameters:
      line - the marker line
      action - the action to execute
    • before

      void before(String line, org.gradle.api.Action<? super Editor> action)
      Restricts edition to lines before the given line.
      Parameters:
      line - the marker line
      action - the action to execute
    • replace

      void replace(String replacement)
      Replaces lines matching the current lower and upper bounds with the provided replacement.
      Parameters:
      replacement - the replacement
    • replace

      void replace(String line, String replacement)
      Replaces lines matching the current lower and upper bounds with the replacement, if they match the line pattern.
      Parameters:
      line - the line pattern
      replacement - the replacement
    • replaceRegex

      void replaceRegex(String regex, String replacement)
      Replaces strings matching the current lower and upper bounds with the replacement, if they match the line pattern.
      Parameters:
      regex - the regex to look for
      replacement - the replacement
    • insert

      void insert(String... lines)
      Inserts the provided lines after the current lower bound.
      Parameters:
      lines - the lines to be inserted