类 NameMatchMethodPointcut

java.lang.Object
infra.core.OrderedSupport
所有已实现的接口:
MethodMatcher, Pointcut, infra.core.ArraySizeTrimmer, infra.core.Ordered, Serializable

public class NameMatchMethodPointcut extends StaticMethodMatcherPointcut implements Serializable, infra.core.ArraySizeTrimmer
Pointcut bean for simple method name matches, as an alternative to regexp patterns.

Does not handle overloaded methods: all methods with a given name will be eligible.

从以下版本开始:
3.0
作者:
Juergen Hoeller, Rod Johnson, Rob Harrop, TODAY 2021/2/3 23:50
另请参阅:
  • 字段详细资料

  • 构造器详细资料

    • NameMatchMethodPointcut

      public NameMatchMethodPointcut()
  • 方法详细资料

    • setMappedName

      public void setMappedName(@Nullable String mappedName)
      Convenience method when we have only a single method name to match. Use either this method or setMappedNames, not both.
      另请参阅:
    • setMappedNames

      public void setMappedNames(@Nullable String... mappedNames)
      Set the method names defining methods to match. Matching will be the union of all these; if any match, the pointcut matches.
      另请参阅:
    • addMethodName

      public NameMatchMethodPointcut addMethodName(String name)
      Add another eligible method name, in addition to those already named. Like the set methods, this method is for use when configuring proxies, before a proxy is used.

      NB: This method does not work after the proxy is in use, as advice chains will be cached.

      参数:
      name - the name of the additional method that will match
      返回:
      this pointcut to allow for multiple additions in one line
    • matches

      public boolean matches(Method method, Class<?> targetClass)
      从接口复制的说明: MethodMatcher
      Checking whether the given method matches.
      指定者:
      matches 在接口中 MethodMatcher
      参数:
      method - the candidate method
      targetClass - the target class
      返回:
      whether or not this method matches on application startup.
    • isMatch

      protected boolean isMatch(String methodName, String mappedName)
      Return if the given method name matches the mapped name.

      The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.

      参数:
      methodName - the method name of the class
      mappedName - the name in the descriptor
      返回:
      if the names match
      另请参阅:
      • StringUtils.simpleMatch(String, String)
    • equals

      public boolean equals(Object other)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • trimToSize

      public void trimToSize()
      指定者:
      trimToSize 在接口中 infra.core.ArraySizeTrimmer