當前位置: 首頁>>代碼示例>>Java>>正文


Java DomUtils.nodeNameEquals方法代碼示例

本文整理匯總了Java中org.springframework.util.xml.DomUtils.nodeNameEquals方法的典型用法代碼示例。如果您正苦於以下問題:Java DomUtils.nodeNameEquals方法的具體用法?Java DomUtils.nodeNameEquals怎麽用?Java DomUtils.nodeNameEquals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.util.xml.DomUtils的用法示例。


在下文中一共展示了DomUtils.nodeNameEquals方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseTopLevelElement

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
/**
 * Parses the top elements belonging to the RFC 124 namespace. Namely these are <component>,
 * <description> and <type-converters>
 * 
 * @param ele
 * @param parserContext
 */
protected void parseTopLevelElement(Element ele, ParserContext parserContext) {
	// description
	if (DomUtils.nodeNameEquals(ele, DESCRIPTION)) {
		// ignore description for now
	} else if (DomUtils.nodeNameEquals(ele, BEAN)) {
		parseComponentElement(ele, parserContext);
	} else if (DomUtils.nodeNameEquals(ele, REFERENCE)) {
		parseReferenceElement(ele, parserContext);
	} else if (DomUtils.nodeNameEquals(ele, SERVICE)) {
		parseServiceElement(ele, parserContext);
	} else if (DomUtils.nodeNameEquals(ele, REFERENCE_LIST)) {
		parseListElement(ele, parserContext);
	} else if (DomUtils.nodeNameEquals(ele, REFERENCE_SET)) {
		parseSetElement(ele, parserContext);
	} else if (DomUtils.nodeNameEquals(ele, TypeConverterBeanDefinitionParser.TYPE_CONVERTERS)) {
		parseConvertersElement(ele, parserContext);
	} else {
		throw new IllegalArgumentException("Unknown element " + ele);
	}
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:28,代碼來源:BlueprintBeanDefinitionParser.java

示例2: parseConstructorArgElements

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
/**
 * Parsers contructor arguments.
 * 
 * @param ele
 * @param beanDefinition
 * @param parserContext
 */
private void parseConstructorArgElements(Element ele, AbstractBeanDefinition beanDefinition) {

	NodeList nl = ele.getChildNodes();
	for (int i = 0; i < nl.getLength(); i++) {
		Node node = nl.item(i);
		if (node instanceof Element && DomUtils.nodeNameEquals(node, CONSTRUCTOR_ARG)) {
			parseConstructorArgElement((Element) node, beanDefinition);
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:18,代碼來源:BlueprintParser.java

示例3: parsePropertyElements

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
/**
 * Parses property elements.
 * 
 * @param ele
 * @param beanDefinition
 * @param parserContext
 */
private void parsePropertyElements(Element ele, AbstractBeanDefinition beanDefinition) {

	NodeList nl = ele.getChildNodes();
	for (int i = 0; i < nl.getLength(); i++) {
		Node node = nl.item(i);
		if (node instanceof Element && DomUtils.nodeNameEquals(node, BeanDefinitionParserDelegate.PROPERTY_ELEMENT)) {
			parsePropertyElement((Element) node, beanDefinition);
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:18,代碼來源:BlueprintParser.java

示例4: parseCollectionElements

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
protected void parseCollectionElements(NodeList elementNodes, Collection<Object> target, BeanDefinition bd,
		String defaultElementType) {

	for (int i = 0; i < elementNodes.getLength(); i++) {
		Node node = elementNodes.item(i);
		if (node instanceof Element
				&& !DomUtils.nodeNameEquals(node, BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
			target.add(parsePropertySubElement((Element) node, bd, defaultElementType));
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:12,代碼來源:BlueprintParser.java

示例5: accept

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public short accept(Element element) {
    if (DomUtils.nodeNameEquals(element, elementName) &&
            isEqualByNamespace(element, elementNamespace) &&
            isEqualByBeanAttributes(element, attributes)) {
        beanDefinitions.add(element);
    }
    
    return NodeFilter.FILTER_ACCEPT;
}
 
開發者ID:christophd,項目名稱:citrus-admin,代碼行數:13,代碼來源:GetSpringBeansFilter.java

示例6: accept

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public short accept(Element element) {
    if (DomUtils.nodeNameEquals(element, elementName) &&
        isEqualByNamespace(element, elementNamespace) &&
        (isEqualById(element, id) || isEqualByBeanName(element, id))) {
        beanDefinition = element;
    }
    
    return NodeFilter.FILTER_ACCEPT;
}
 
開發者ID:christophd,項目名稱:citrus-admin,代碼行數:13,代碼來源:GetSpringBeanFilter.java

示例7: accept

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public short accept(Element element) {
    if (DomUtils.nodeNameEquals(element, "beans")) {
        element.appendChild(element.getOwnerDocument().createTextNode("\n    ")); //TODO make indentation configurable
        element.appendChild(element.getOwnerDocument().importNode(beanDefinition, true));
    }
    
    return NodeFilter.FILTER_ACCEPT;
}
 
開發者ID:christophd,項目名稱:citrus-admin,代碼行數:12,代碼來源:AddSpringBeanFilter.java

示例8: startElement

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
@Override
public short startElement(Element element) {
    if (DomUtils.nodeNameEquals(element, "import")) {
        String resourceLocation = element.getAttribute("resource");

        if (StringUtils.hasText(resourceLocation)) {
            if (resourceLocation.startsWith("classpath:")) {
                resourceLocation = resourceLocation.substring("classpath:".length());
            } else if (resourceLocation.startsWith("file:")) {
                resourceLocation = resourceLocation.substring("file:".length());
            }

            try {
                File importedFile = new FileSystemResource(parentConfigFile.getParentFile().getCanonicalPath() +
                        File.separator + resourceLocation).getFile();

                if (importedFile.exists()) {
                    importedFiles.add(importedFile);
                }
            } catch (IOException e) {
                log.warn("Unable to resolve imported file resource location", e);
            }
        }
    }

    return NodeFilter.FILTER_ACCEPT;
}
 
開發者ID:christophd,項目名稱:citrus-admin,代碼行數:28,代碼來源:GetSpringImportsFilter.java

示例9: parsePropertySubElement

import org.springframework.util.xml.DomUtils; //導入方法依賴的package包/類
/**
 * Parse a value, ref or collection sub-element of a property or constructor-arg element. This method is called from
 * several places to handle reusable elements such as idref, ref, null, value and so on.
 * 
 * In fact, this method is the main reason why the BeanDefinitionParserDelegate is not used in full since the
 * element namespace becomes important as mixed rfc124/bean content can coexist.
 * 
 * @param ele subelement of property element; we don't know which yet
 * @param defaultValueType the default type (class name) for any <code>&lt;value&gt;</code> tag that might be
 * created
 */
private Object parsePropertySubElement(Element ele, BeanDefinition bd, String defaultValueType) {
	// skip other namespace
	String namespaceUri = ele.getNamespaceURI();

	// check Spring own namespace
	if (parserContext.getDelegate().isDefaultNamespace(namespaceUri)) {
		return parserContext.getDelegate().parsePropertySubElement(ele, bd);
	}
	// let the delegate handle other ns
	else if (!NAMESPACE_URI.equals(namespaceUri)) {
		return parserContext.getDelegate().parseCustomElement(ele);
	}

	// 
	else {
		if (DomUtils.nodeNameEquals(ele, BEAN)) {
			BeanDefinitionHolder bdHolder = parseComponentDefinitionElement(ele, bd);
			if (bdHolder != null) {
				bdHolder = ParsingUtils.decorateBeanDefinitionIfRequired(ele, bdHolder, parserContext);
			}
			return bdHolder;
		}

		if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.REF_ELEMENT)) {
			return parseRefElement(ele);
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.IDREF_ELEMENT)) {
			return parseIdRefElement(ele);
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.VALUE_ELEMENT)) {
			return parseValueElement(ele, defaultValueType);
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.NULL_ELEMENT)) {
			// It's a distinguished null value. Let's wrap it in a TypedStringValue
			// object in order to preserve the source location.
			TypedStringValue nullHolder = new TypedStringValue(null);
			nullHolder.setSource(parserContext.extractSource(ele));
			return nullHolder;
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.ARRAY_ELEMENT)) {
			return parseArrayElement(ele, bd);
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.LIST_ELEMENT)) {
			return parseListElement(ele, bd);
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.SET_ELEMENT)) {
			return parseSetElement(ele, bd);
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.MAP_ELEMENT)) {
			return parseMapElement(ele, bd);
		} else if (DomUtils.nodeNameEquals(ele, BeanDefinitionParserDelegate.PROPS_ELEMENT)) {
			return parsePropsElement(ele);
		}

		// maybe it's a nested service/reference/ref-list/ref-set
		return parserContext.getDelegate().parseCustomElement(ele, bd);
	}
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:63,代碼來源:BlueprintParser.java


注:本文中的org.springframework.util.xml.DomUtils.nodeNameEquals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。