Class RegexNameRewriter
java.lang.Object
org.infinispan.security.mappers.RegexNameRewriter
- All Implemented Interfaces:
NameRewriter
A simple regular expression-based name rewriter.
-
Field Summary
Fields inherited from interface org.infinispan.security.mappers.NameRewriter
IDENTITY_REWRITER -
Constructor Summary
ConstructorsConstructorDescriptionRegexNameRewriter(Pattern pattern, String replacement, boolean replaceAll) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the pattern.Get the replacement string.booleanWhether this rewriter replaces all occurrences of the patter or just the firstrewriteName(String original) Rewrite a name.
-
Constructor Details
-
RegexNameRewriter
Construct a new instance.- Parameters:
pattern- the substitution pattern (must not benull)replacement- the replacement stringreplaceAll-trueto replace all occurrences of the pattern;falseto replace only the first occurrence
-
-
Method Details
-
rewriteName
Rewrite a name. Must not returnnull.- Specified by:
rewriteNamein interfaceNameRewriter- Parameters:
original- the original name- Returns:
- the rewritten name
-
getPattern
-
getReplacement
-
isReplaceAll
public boolean isReplaceAll()Whether this rewriter replaces all occurrences of the patter or just the first
-