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

com.flagwind.services.base.DefaultMatcher Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
package com.flagwind.services.base;

import com.flagwind.services.Matchable;
import com.flagwind.services.Matcher;

/**
 * 服务提供者工厂
 * 
 * @author chendb
 * @date 2015年10月21日 上午10:55:05
 */
public class DefaultMatcher implements Matcher {

    public static final DefaultMatcher Default = new DefaultMatcher();

    public boolean match(Object target, Object parameter) {
        if (target == null)
            return false;

        if (target instanceof Matchable) {
            return ((Matchable) target).isMatch(parameter);
        }

        // var attribute = (MatcherAttribute)Attribute.GetCustomAttribute(target.GetType(), typeof(MatcherAttribute), true);

        // if(attribute != null && attribute.Matcher != null)
        //     return attribute.Matcher.Match(target, parameter);

        //注意:默认返回必须是真
        return true;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy