class GlobalFilterParser extends AbstractSimpleBeanDefinitionParser implements
                                                                          SofaBootTagNameSupport {

    private static final Logger LOGGER            = SofaBootRpcLoggerFactory
                                                      .getLogger(GlobalFilterParser.class);
    private static final String TAG_GLOBAL_FILTER = "rpc-global-filter";
    private static final String TAG_REF           = "ref";
    private static final String TAG_CLASS         = "class";

    /**
     * 从 XML 解析全局 Filter。
     *
     * @param element
     * @param parserContext
     * @param builder
     */
    @Override
    protected void doParse(Element element, ParserContext parserContext,
                           BeanDefinitionBuilder builder) {<FILL_FUNCTION_BODY>}

    /**
     * 支持的 tag 名字
     *
     * @return 支持的 tag 名字
     */
    @Override
    public String supportTagName() {
        return TAG_GLOBAL_FILTER;
    }

    @Override
    protected boolean shouldGenerateIdAsFallback() {
        return true;
    }

    @Override
    protected Class<?> getBeanClass(Element element) {
        return Object.class;
    }

}


        String filterId = element.getAttribute(TAG_REF);
        String filterClass = element.getAttribute(TAG_CLASS);

        if (StringUtils.hasText(filterId)) {
            RpcFilterContainer.getInstance().addFilterId(filterId);
            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("global filter take effect[" + filterId + "]");
            }
            return;
        }
        if (StringUtils.hasText(filterClass)) {
            RpcFilterContainer.getInstance().addFilterClass(filterClass);
            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("global filter take effect[" + filterClass + "]");
            }
            return;
        }

        if (LOGGER.isWarnEnabled()) {
            LOGGER
                .warn("both the ref attr and class attr is blank, this rpc global filter is invalid");
        }

    
<methods>public void <init>() <variables>