mulebeandefinitiondocumentreader.java

来自「提供ESB 应用mule源代码 提供ESB 应用mule源代码」· Java 代码 · 共 50 行

JAVA
50
字号
/* * $Id: MuleBeanDefinitionDocumentReader.java 11964 2008-06-05 19:31:23Z dfeist $ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */package org.mule.config.spring;import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;import org.springframework.beans.factory.xml.XmlReaderContext;import org.springframework.util.StringUtils;import org.w3c.dom.Element;/** * Allows us to hook in our own Hierarchical Parser delegate. this enables the * parsing of custom spring bean elements nested within each other */public class MuleBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader{    protected BeanDefinitionParserDelegate createHelper(XmlReaderContext readerContext, Element root)    {        BeanDefinitionParserDelegate delegate = new MuleHierarchicalBeanDefinitionParserDelegate(readerContext, this);        delegate.initDefaults(root);        return delegate;    }    /**     * Override to reject configuration files with no namespace, e.g. mule legacy     * configuration file.     */    protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate)    {        if (!StringUtils.hasLength(root.getNamespaceURI()))        {            getReaderContext().error("Unable to locate NamespaceHandler for namespace [null]", root);        }        else        {            super.parseBeanDefinitions(root, delegate);        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?