Search in sources :

Example 1 with Interceptor

use of org.apache.ibatis.plugin.Interceptor in project mybatis-3 by mybatis.

the class XMLConfigBuilder method pluginElement.

private void pluginElement(XNode parent) throws Exception {
    if (parent != null) {
        for (XNode child : parent.getChildren()) {
            String interceptor = child.getStringAttribute("interceptor");
            Properties properties = child.getChildrenAsProperties();
            Interceptor interceptorInstance = (Interceptor) resolveClass(interceptor).newInstance();
            interceptorInstance.setProperties(properties);
            configuration.addInterceptor(interceptorInstance);
        }
    }
}
Also used : XNode(org.apache.ibatis.parsing.XNode) Properties(java.util.Properties) Interceptor(org.apache.ibatis.plugin.Interceptor)

Aggregations

Properties (java.util.Properties)1 XNode (org.apache.ibatis.parsing.XNode)1 Interceptor (org.apache.ibatis.plugin.Interceptor)1