Class RegexNameValidatingRewriter

java.lang.Object
org.wildfly.security.auth.util.RegexNameValidatingRewriter
All Implemented Interfaces:
NameRewriter

public final class RegexNameValidatingRewriter extends Object implements NameRewriter
A regular expression-based name validation rewriter. Always returns the original name if the name is valid.
Author:
David M. Lloyd
  • Constructor Details

    • RegexNameValidatingRewriter

      public RegexNameValidatingRewriter(Pattern pattern, boolean match)
      Construct a new instance. The pattern is a partial pattern; if the whole string is to be matched, then the appropriate regex anchors should be used.
      Parameters:
      pattern - the pattern that the name must match (or not match) in order to be considered valid (must not be null)
      match - true if the pattern must match, false if the pattern must not match
  • Method Details

    • rewriteName

      public String rewriteName(String original)
      Specified by:
      rewriteName in interface NameRewriter
    • getPattern

      public Pattern getPattern()
      Get the pattern.
      Returns:
      the pattern
    • isMatch

      public boolean isMatch()
      Get the match flag. If the flag is true, the pattern must match; if false, the pattern must not match.
      Returns:
      the match flag