org.springframework.aop.support

Class NameMatchMethodPointcut

    • Constructor Detail

      • NameMatchMethodPointcut

        public NameMatchMethodPointcut()
    • Method Detail

      • setMappedName

        public void setMappedName(java.lang.String mappedName)
        Convenience method when we have only a single method name to match. Use either this method or setMappedNames, not both.
        See Also:
        setMappedNames(java.lang.String...)
      • setMappedNames

        public void setMappedNames(java.lang.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(java.lang.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.

        Parameters:
        name - name of the additional method that will match
        Returns:
        this pointcut to allow for multiple additions in one line
      • isMatch

        protected boolean isMatch(java.lang.String methodName,
                                  java.lang.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.

        Parameters:
        methodName - the method name of the class
        mappedName - the name in the descriptor
        Returns:
        if the names match
        See Also:
        PatternMatchUtils.simpleMatch(String, String)
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object