spring-framework / org.springframework.aop.support / AbstractRegexpMethodPointcut

AbstractRegexpMethodPointcut

abstract class AbstractRegexpMethodPointcut : StaticMethodMatcherPointcut, Serializable

Abstract base regular expression pointcut bean. JavaBean properties are:

Note: the regular expressions must be a match. For example, .*get.* will match com.mycom.Foo.getBar(). get.* will not.

This base class is serializable. Subclasses should declare all fields transient; the #initPatternRepresentation method will be invoked again on deserialization.

Author
Rod Johnson

Author
Juergen Hoeller

Author
Rob Harrop

Since
1.1

See Also
JdkRegexpMethodPointcut

Constructors

<init>

AbstractRegexpMethodPointcut()

Abstract base regular expression pointcut bean. JavaBean properties are:

  • pattern: regular expression for the fully-qualified method names to match. The exact regexp syntax will depend on the subclass (e.g. Perl5 regular expressions)
  • patterns: alternative property taking a String array of patterns. The result will be the union of these patterns.

Note: the regular expressions must be a match. For example, .*get.* will match com.mycom.Foo.getBar(). get.* will not.

This base class is serializable. Subclasses should declare all fields transient; the #initPatternRepresentation method will be invoked again on deserialization.

Functions

equals

open fun equals(other: Any?): Boolean

getExcludedPatterns

open fun getExcludedPatterns(): Array<String>

Returns the regular expressions for exclusion matching.

getPatterns

open fun getPatterns(): Array<String>

Return the regular expressions for method matching.

hashCode

open fun hashCode(): Int

matches

open fun matches(method: Method, targetClass: Class<*>): Boolean

Try to match the regular expression against the fully qualified name of the target class as well as against the method's declaring class, plus the name of the method.

setExcludedPattern

open fun setExcludedPattern(excludedPattern: String): Unit

Convenience method when we have only a single exclusion pattern. Use either this method or #setExcludedPatterns, not both.

setExcludedPatterns

open fun setExcludedPatterns(vararg excludedPatterns: String): Unit

Set the regular expressions defining methods to match for exclusion. Matching will be the union of all these; if any match, the pointcut matches.

setPattern

open fun setPattern(pattern: String): Unit

Convenience method when we have only a single pattern. Use either this method or #setPatterns, not both.

setPatterns

open fun setPatterns(vararg patterns: String): Unit

Set the regular expressions defining methods to match. Matching will be the union of all these; if any match, the pointcut matches.

toString

open fun toString(): String

Inheritors

JdkRegexpMethodPointcut

open class JdkRegexpMethodPointcut : AbstractRegexpMethodPointcut

Regular expression pointcut based on the java.util.regex package. Supports the following JavaBean properties:

  • pattern: regular expression for the fully-qualified method names to match
  • patterns: alternative property taking a String array of patterns. The result will be the union of these patterns.

Note: the regular expressions must be a match. For example, .*get.* will match com.mycom.Foo.getBar(). get.* will not.