Example usage for org.apache.ibatis.plugin PluginException PluginException

List of usage examples for org.apache.ibatis.plugin PluginException PluginException

Introduction

In this page you can find the example usage for org.apache.ibatis.plugin PluginException PluginException.

Prototype

public PluginException(String message, Throwable cause) 

Source Link

Usage

From source file:com.fjn.helper.frameworkex.mybatis.plugin.PluginEnhancement.java

License:Apache License

private static Map<Class<?>, Set<Method>> getSignatureMap(Interceptor interceptor) {
    Signature[] sigs = interceptor.getClass().getAnnotation(Intercepts.class).value();
    Map<Class<?>, Set<Method>> signatureMap = new HashMap<Class<?>, Set<Method>>();
    for (Signature sig : sigs) {
        Set<Method> methods = signatureMap.get(sig.type());
        if (methods == null) {
            methods = new HashSet<Method>();
            signatureMap.put(sig.type(), methods);
        }/*from   w w w .  j a v a 2  s  .  c  o  m*/
        try {
            Method method = sig.type().getMethod(sig.method(), sig.args());
            methods.add(method);
        } catch (NoSuchMethodException e) {
            throw new PluginException(
                    "Could not find method on " + sig.type() + " named " + sig.method() + ". Cause: " + e, e);
        }
    }
    return signatureMap;
}