All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.inspiresoftware.lib.dto.geda.interceptor.impl.GeDAMethodRegExMatcherPointcut Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
/*
 * This code is distributed under The GNU Lesser General Public License (LGPLv3)
 * Please visit GNU site for LGPLv3 http://www.gnu.org/copyleft/lesser.html
 *
 * Copyright Denis Pavlov 2009
 * Web: http://www.inspire-software.com
 * SVN: https://geda-genericdto.svn.sourceforge.net/svnroot/geda-genericdto
 */

package com.inspiresoftware.lib.dto.geda.interceptor.impl;

import com.inspiresoftware.lib.dto.geda.interceptor.AdviceConfigResolver;
import org.springframework.aop.support.JdkRegexpMethodPointcut;

import java.lang.reflect.Method;

/**
 * RegEx matcher with match the regular expression using the
 * {@link org.springframework.aop.support.JdkRegexpMethodPointcut} and then
 * will use basic {@link com.inspiresoftware.lib.dto.geda.interceptor.impl.GeDAMethodMatcherPointcut}
 * functionality.
 *
 * Please note that {@link org.springframework.aop.support.AbstractRegexpMethodPointcut} matches on union (OR)
 * of targetClass.getName() and method.getDeclaringClass().getName(), so both implementation and interfaces must
 * conform to match exclusions (if you have any).
 * 

* User: denispavlov * Date: May 1, 2012 * Time: 10:00:00 AM */ public class GeDAMethodRegExMatcherPointcut extends GeDAMethodMatcherPointcut { private JdkRegexpMethodPointcut regexPointcut = new JdkRegexpMethodPointcut(); /** * Uses {@link org.springframework.aop.support.JdkRegexpMethodPointcut} to work with regex * matching. * * @param resolver resolver that will actually match the invocations */ public GeDAMethodRegExMatcherPointcut(final AdviceConfigResolver resolver) { super(resolver); } /** * Set the regular expressions defining methods to match. * Matching will be the union of all these; if any match, * the pointcut matches. */ public void setPatterns(String[] patterns) { regexPointcut.setPatterns(patterns); } /** * Set the regular expressions defining methods to match for exclusion. * Matching will be the union of all these; if any match, * the pointcut matches. */ public void setExcludedPatterns(String[] excludedPatterns) { regexPointcut.setExcludedPatterns(excludedPatterns); } /** {@inheritDoc} */ @Override public boolean matches(final Method method, final Class targetClass) { return regexPointcut.matches(method, targetClass); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy