org.nutz.ioc.aop.config.impl.AopConfigrationItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nutz Show documentation
Show all versions of nutz Show documentation
Nutz, which is a collections of lightweight frameworks, each of them can be used independently
package org.nutz.ioc.aop.config.impl;
import java.util.regex.Pattern;
import org.nutz.aop.MethodMatcher;
import org.nutz.aop.matcher.MethodMatcherFactory;
/**
*
*
* @author wendal([email protected])
*
*/
public class AopConfigrationItem {
private String className;
private String methodName;
private String interceptor;
private boolean singleton;
private MethodMatcher methodMatcher;
private Pattern classnamePattern;
public MethodMatcher getMethodMatcher() {
return methodMatcher;
}
public boolean matchClassName(String className) {
return classnamePattern.matcher(className).find();
}
public AopConfigrationItem() {}
public AopConfigrationItem( String className,
String methodName,
String interceptor,
boolean singleton) {
super();
this.className = className;
this.methodName = methodName;
this.interceptor = interceptor;
this.singleton = singleton;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
this.classnamePattern = Pattern.compile(className);
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
this.methodMatcher = MethodMatcherFactory.matcher(methodName);
}
public String getInterceptor() {
return interceptor;
}
public void setInterceptor(String interceptor) {
this.interceptor = interceptor;
}
public boolean isSingleton() {
return singleton;
}
public void setSingleton(boolean singleton) {
this.singleton = singleton;
}
}