Class Placeholders

java.lang.Object
pro.verron.officestamper.experimental.Placeholders

public class Placeholders extends Object
The Expressions class provides utility methods for finding variables and processors in a given text. It contains multiple constant variables for different types of expressions, such as VAR_MATCHER for variable expressions and PROC_MATCHER for processor expressions. The findVariables() method uses VAR_FINDER to find variable expressions in a given text and returns a list of found expressions. The findProcessors() method uses PROC_FINDER to find processor expressions in a given text and returns a list of found expressions. The raw() method creates a new Expression object using the RAW_MATCHER and a specified text.
  • Method Details

    • findVariables

      public static List<Placeholder> findVariables(Paragraph paragraph)
      Finds variable expressions in a given paragraph.
      Parameters:
      paragraph - the paragraph in which to search for variable expressions
      Returns:
      a list of found variable expressions as Placeholder objects
    • findVariables

      public static List<Placeholder> findVariables(String text)
      Finds variable expressions in a given text.
      Parameters:
      text - the text to search for variable expressions
      Returns:
      a list of found variable expressions as StandardPlaceholder objects
    • findProcessors

      public static List<Placeholder> findProcessors(String text)
      Finds processors expressions in a given text.
      Parameters:
      text - the text to search for processor expressions
      Returns:
      a list of found processor expressions as StandardPlaceholder objects
    • raw

      public static Placeholder raw(String text)
      Creates a new raw placeholder with the given text.
      Parameters:
      text - the text to be used as the content of the placeholder
      Returns:
      a new raw placeholder