Class StringTextMatcher

java.lang.Object
org.fest.swing.util.StringTextMatcher
All Implemented Interfaces:
TextMatcher

public class StringTextMatcher extends Object implements TextMatcher
Understands matching text to a group of String values. Matching is perform by equality or by regular expression matching.
  • Field Details

    • values

      private final String[] values
  • Constructor Details

  • Method Details

    • isMatching

      public boolean isMatching(String text)
      Indicates whether the given text matches the String values in this matcher. Each value can be a regular expression.
      Specified by:
      isMatching in interface TextMatcher
      Parameters:
      text - the text to verify.
      Returns:
      true if the given text matches the String values in this matcher, false otherwise.
    • description

      public String description()
      Returns "value" if this matcher contains only one value, or "values" if this matcher contains more than one value.
      Specified by:
      description in interface TextMatcher
      Returns:
      "value" if this matcher contains only one value, or "values" if this matcher contains more than one value.
    • formattedValues

      public String formattedValues()
      Returns the String values in this matcher, formatted as a single String.
      Specified by:
      formattedValues in interface TextMatcher
      Returns:
      the String values in this matcher, formatted as a single String.
    • onlyOneValue

      private boolean onlyOneValue()