Code example for Element

Methods: getAttribute, hasAttribute

0
class DefaultMybatisCacheAspectBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { 
 
    @Override 
    protected void doParse(Element element, BeanDefinitionBuilder builder) {
        // 设置order值 
        builder.addPropertyValue("order", element.getAttribute("order"));
        // 如果指定了cacheService名称,则注入 
        if (element.hasAttribute("cacheService-ref")) {
            builder.addPropertyReference("cacheService", element.getAttribute("cacheService-ref"));
        } 
    } 
 
    @Override 
    protected Class<?> getBeanClass(Element element) {
        return MybatisCacheAspectInterceptor.class; 
    } 
}