⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grandchilddefinitionparser.java

📁 提供ESB 应用mule源代码 提供ESB 应用mule源代码
💻 JAVA
字号:
/* * $Id: GrandchildDefinitionParser.java 11968 2008-06-06 04:06:18Z 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.parsers.generic;import org.w3c.dom.Element;import org.w3c.dom.Node;/** * Same as ChildDefinitionParser but injects the child element into the grandparent object  * (2 levels up in the XML tree). */public class GrandchildDefinitionParser extends ChildDefinitionParser{    public GrandchildDefinitionParser(String setterMethod, Class clazz)    {        super(setterMethod, clazz);    }    public GrandchildDefinitionParser(String setterMethod, Class clazz, Class constraint, boolean allowClassAttribute)    {        super(setterMethod, clazz, constraint, allowClassAttribute);    }    //@Override    protected String getParentBeanName(Element element)    {        return getGrandparentBeanName(element);    }    protected String getGrandparentBeanName(Element element)    {        Node parent = element.getParentNode();        if (parent == null)        {            logger.error("No parent node found for element " + element);            return null;        }        Node grandparent = parent.getParentNode();        if (grandparent == null)        {            logger.error("No parent node found for element " + parent);            return null;        }        Node grandparentNameAttribute = grandparent.getAttributes().getNamedItem("name");        if (grandparentNameAttribute == null)        {            logger.error("Grandparent node has no 'name' attribute: " + grandparent);            return null;        }        return grandparentNameAttribute.getNodeValue();    }}

⌨️ 快捷键说明

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