Class IOParameterRefReplacer

java.lang.Object
de.aristaflow.adept2.model.common.paramref.IOParameterRefParser
de.aristaflow.adept2.model.common.paramref.IOParameterRefReplacer

public class IOParameterRefReplacer extends IOParameterRefParser
Facilitates the process of parameterised strings and replace the parameter references with values. It works similarly to Matcher and is supposed to be used in a loop like this:
 SystemDataTools.Formatter formatter = SystemDataTools.getFormatter(<string>);
 while (formatter.findNext())
 {
   ...
   formatter.replaceWith(<someValue>);
 }
 System.out.println(formatter.getProcessedString());
 
Instances are created using ParameterRefTools.getIOReplacer(String, EnumSet) or other specialised variants if available.
  • Method Details

    • findNext

      public boolean findNext()
      Finds the next parameter reference. Once this method returns false the processed string is complete.
      Overrides:
      findNext in class IOParameterRefParser
      Returns:
      if a next parameter reference was found
    • replaceWith

      public void replaceWith(String string)
      Replace the current parameter reference with the specified string. This method is optional, i.e. not every parameter reference must be replaced.
      Parameters:
      string - the string to replace the current parameter reference with
    • getProcessedString

      public String getProcessedString()
      Returns the processed string.
      Returns:
      the processed string