public abstract class

PatternMatchUtils

extends Object
java.lang.Object
   ↳ org.springframework.util.PatternMatchUtils

Class Overview

Utility methods for simple pattern matching, in particular for Spring's typical "xxx*", "*xxx" and "*xxx*" pattern styles.

Summary

Public Constructors
PatternMatchUtils()
Public Methods
static boolean simpleMatch(String[] patterns, String str)
Match a String against the given patterns, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.
static boolean simpleMatch(String pattern, String str)
Match a String against the given pattern, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PatternMatchUtils ()

Also: SpringCore

Public Methods

public static boolean simpleMatch (String[] patterns, String str)

Also: SpringCore

Match a String against the given patterns, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.

Parameters
patterns the patterns to match against
str the String to match
Returns
  • whether the String matches any of the given patterns

public static boolean simpleMatch (String pattern, String str)

Also: SpringCore

Match a String against the given pattern, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.

Parameters
pattern the pattern to match against
str the String to match
Returns
  • whether the String matches the given pattern