Class Substitution

java.lang.Object
com.mooltiverse.oss.nyx.entities.Substitution

public class Substitution extends Object
This object models a rule to replace some text matched by a regular expression in arbitrary text files with a static or dynamic value that is configured within the rule.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Substitution(String files, String match, String replace)
    Standard constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the glob expression to select the text files to replace the matched strings into.
    Returns the regular expression used to match the text to be replaced replace in files.
    Returns the template expression defining the text to use when replacing all matched tokens.
    void
    Sets the glob expression to select the text files to replace the matched strings into.
    void
    Sets the regular expression used to match the text to be replaced replace in files.
    void
    setReplace(String replace)
    Sets the template expression defining the text to use when replacing all matched tokens.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Substitution

      public Substitution()
      Default constructor.
    • Substitution

      public Substitution(String files, String match, String replace)
      Standard constructor.
      Parameters:
      files - the glob expression to select the text files to replace the matched strings into.
      match - the regular expression used to match the text to be replaced replace in files.
      replace - the template expression defining the text to use when replacing all matched tokens.
  • Method Details

    • getFiles

      public String getFiles()
      Returns the glob expression to select the text files to replace the matched strings into.
      Returns:
      the glob expression to select the text files to replace the matched strings into.
    • setFiles

      public void setFiles(String files)
      Sets the glob expression to select the text files to replace the matched strings into.
      Parameters:
      files - glob expression to select the text files to replace the matched strings into.
    • getMatch

      public String getMatch()
      Returns the regular expression used to match the text to be replaced replace in files.
      Returns:
      the regular expression used to match the text to be replaced replace in files.
    • setMatch

      public void setMatch(String match)
      Sets the regular expression used to match the text to be replaced replace in files.
      Parameters:
      match - the regular expression used to match the text to be replaced replace in files.
    • getReplace

      public String getReplace()
      Returns the template expression defining the text to use when replacing all matched tokens.
      Returns:
      the template expression defining the text to use when replacing all matched tokens.
    • setReplace

      public void setReplace(String replace)
      Sets the template expression defining the text to use when replacing all matched tokens.
      Parameters:
      replace - the template expression defining the text to use when replacing all matched tokens.