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

org.nutz.ioc.aop.config.impl.AopConfigrationItem Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.72
Show newest version
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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy