当前位置: 首页>>代码示例>>Java>>正文


Java BeanDefinitionParser类代码示例

本文整理汇总了Java中org.springframework.beans.factory.xml.BeanDefinitionParser的典型用法代码示例。如果您正苦于以下问题:Java BeanDefinitionParser类的具体用法?Java BeanDefinitionParser怎么用?Java BeanDefinitionParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BeanDefinitionParser类属于org.springframework.beans.factory.xml包,在下文中一共展示了BeanDefinitionParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerParser

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
protected void registerParser(String elementName, String className) {
	// logger.info("registerParser elementName:" + elementName + " className:" + className);
	BeanDefinitionParser parser;
	try {
		parser = getBeanDefinitionParser(elementName, className);
		// logger.info("registerParser elementName:" + elementName + " parser:" + parser);
	}
	catch (Exception e) {
		logger.error(e.getMessage(), e);
		return;
	}
	// try {
	// parser = (BeanDefinitionParser) Class.forName(className).newInstance();
	// }
	// catch (Exception e) {
	// // throw new RuntimeException(e.getMessage(), e);
	// return;
	// }

	registerBeanDefinitionParser(elementName, parser);
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:22,代码来源:LeopardNamespaceHandler.java

示例2: getBeanDefinitionParser

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
protected BeanDefinitionParser getBeanDefinitionParser(String elementName, String className) throws Exception {
	boolean useH2 = isUseH2();
	if (!useH2) {
		return (BeanDefinitionParser) Class.forName(className).newInstance();
	}

	String h2ClassName = className.replace("io.leopard.schema", "io.leopard.schema.h2");
	Class<?> clazz;
	try {
		clazz = Class.forName(h2ClassName);
	}
	catch (ClassNotFoundException e) {
		clazz = Class.forName(className);
	}
	return (BeanDefinitionParser) clazz.newInstance();
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:17,代码来源:LeopardNamespaceHandler.java

示例3: parseListElement

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
private void parseListElement(Element ele, ParserContext parserContext) {
	BeanDefinitionParser parser = new BlueprintCollectionBeanDefinitionParser() {

		@Override
		protected CollectionType collectionType() {
			return CollectionType.LIST;
		}
	};
	parser.parse(ele, parserContext);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:11,代码来源:BlueprintBeanDefinitionParser.java

示例4: parseSetElement

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
private void parseSetElement(Element ele, ParserContext parserContext) {
	BeanDefinitionParser parser = new BlueprintCollectionBeanDefinitionParser() {

		@Override
		protected CollectionType collectionType() {
			return CollectionType.SET;
		}
	};

	parser.parse(ele, parserContext);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:12,代码来源:BlueprintBeanDefinitionParser.java

示例5: parseTestStepComponents

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
private static void parseTestStepComponents(List<Element> childElements,
			BeanDefinition beanDef, ParserContext parserContext) {
		ManagedList<BeanDefinition> children = new ManagedList<BeanDefinition>(//NOPMD
				childElements.size());
		for (Element element : childElements) {
			BeanDefinitionParser bep = XsdNameSpaceParserRegistry.getNameSpaceHandlerRegistry().get(element.getLocalName());
			if (null == bep) throw GlobalUtils.createNotInitializedException("Name space handler not registered for this element: " + element.getTagName());
			BeanDefinition tmpBDef = bep.parse(element, parserContext);
			tmpBDef.getPropertyValues().removePropertyValue(tmpBDef.getPropertyValues().getPropertyValue(XsdElementConstants.MEMBER_BASETESTSTEP_TESTCASE));
			children.add(tmpBDef);
			
//			if (element.getTagName() == "ate:" //NOPMD
//					+ XsdElementConstants.ELEMENT_HOMESTEP) {
//				HomeStepBeanDefinitionParser homeStep = new HomeStepBeanDefinitionParser();
//				BeanDefinition tmpBDef = homeStep.parse(element, parserContext);
//				tmpBDef.getPropertyValues().removePropertyValue(tmpBDef.getPropertyValues().getPropertyValue(XsdElementConstants.MEMBER_BASETESTSTEP_TESTCASE));
//				
//				children.add(tmpBDef);
//			} else if (element.getTagName() == "ate:"
//					+ XsdElementConstants.ELEMENT_ELEMENTSTEP) {
//				ElementStepBeanDefinitionParser elementStep = new ElementStepBeanDefinitionParser();
//				BeanDefinition tmpBDef = elementStep.parse(element, parserContext);
//				tmpBDef.getPropertyValues().removePropertyValue(tmpBDef.getPropertyValues().getPropertyValue(XsdElementConstants.MEMBER_BASETESTSTEP_TESTCASE));
//				
//				children.add(tmpBDef);
//			} else if (element.getTagName() == "ate:"
//					+ XsdElementConstants.ELEMENT_LASTSTEP) {
//				LastStepBeanDefinitionParser lastStep = new LastStepBeanDefinitionParser();
//				BeanDefinition tmpBDef = lastStep.parse(element, parserContext);
//				tmpBDef.getPropertyValues().removePropertyValue(tmpBDef.getPropertyValues().getPropertyValue(XsdElementConstants.MEMBER_BASETESTSTEP_TESTCASE));
//				
//				children.add(tmpBDef);
//		
//			}
		}
		beanDef.getPropertyValues().addPropertyValue(
				XsdElementConstants.MEMBER_STEPTYPESERVICE_STEPSET, children);
	}
 
开发者ID:bigtester,项目名称:automation-test-engine,代码行数:39,代码来源:StepTypeServiceBeanDefinitionParser.java

示例6: parseAsserterComponents

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
private static void parseAsserterComponents(List<Element> childElements,
		BeanDefinition beanDef, ParserContext parserContext) {
	ManagedList<BeanDefinition> children = new ManagedList<BeanDefinition>(//NOPMD
			childElements.size());
	for (Element element : childElements) {
		BeanDefinitionParser bep = XsdNameSpaceParserRegistry.getNameSpaceHandlerRegistry().get(element.getLocalName());
		if (null == bep) throw GlobalUtils.createNotInitializedException("Name space handler not registered for this element: " + element.getTagName());
		BeanDefinition tmpBDef = bep.parse(element, parserContext);
		children.add(tmpBDef);
		
	}
	beanDef.getPropertyValues().addPropertyValue(
			"expectedResultAsserter", children);
}
 
开发者ID:bigtester,项目名称:automation-test-engine,代码行数:15,代码来源:BaseTestStepBeanDefinitionParser.java

示例7: init

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void init() {
	Map<String, BeanDefinitionParser> userParsers = XsdNameSpaceParserRegistry.getNameSpaceHandlerRegistry();
	for (Map.Entry<String, BeanDefinitionParser> parser : userParsers.entrySet()) {
		registerBeanDefinitionParser(parser.getKey(), parser.getValue());
	}
}
 
开发者ID:bigtester,项目名称:automation-test-engine,代码行数:11,代码来源:AteNamespaceHandler.java

示例8: getParser

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BeanDefinitionParser getParser() {
	final JavaCodedStepNameSpaceParser nameSpaceParser2 = nameSpaceParser;
	if (nameSpaceParser2 == null) {
		return new JavaCodedStepNameSpaceParser();// NOPMD
	} else {
		return nameSpaceParser2;

	}
}
 
开发者ID:bigtester,项目名称:automation-test-engine,代码行数:14,代码来源:JavaCodedStep.java

示例9: registerBoxedTypeElementParsers

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
/**
 * Register bean definition parsers for supported boxed-primitive creation elements.
 * Use reflection to attach the correct parsers by naming conventions of both the
 * elements and parser classes
 *
 * @param boxedElementTypes
 *            list of supported boxed-primitive types
 */
private void registerBoxedTypeElementParsers(final List<Class<?>> boxedElementTypes)
{
	for (final Class<?> elementType : boxedElementTypes)
	{
		final String typeName = elementType.getSimpleName();
		final String elementName = typeName.toLowerCase();
		final Class<? extends BeanDefinitionParser> parserClass = loadParserClass(
				elementName, typeName + BOXED_BEAN_DEFINITION_PARSER_SUFFIX);
		final BeanDefinitionParser parserInstance = getParserInstance(parserClass);
		registerBeanDefinitionParser(elementName, parserInstance);
	}
}
 
开发者ID:openfurther,项目名称:further-open-core,代码行数:21,代码来源:CoreNamespaceHandler.java

示例10: parseReferenceElement

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
private void parseReferenceElement(Element ele, ParserContext parserContext) {
	BeanDefinitionParser parser = new BlueprintReferenceBeanDefinitionParser();
	parser.parse(ele, parserContext);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:5,代码来源:BlueprintBeanDefinitionParser.java

示例11: parseServiceElement

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
private void parseServiceElement(Element ele, ParserContext parserContext) {
	BeanDefinitionParser parser = new BlueprintServiceDefinitionParser();
	parser.parse(ele, parserContext);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:5,代码来源:BlueprintBeanDefinitionParser.java

示例12: getCacheProviderFacadeParser

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
protected BeanDefinitionParser getCacheProviderFacadeParser() {
  return cacheProviderFacadeParser;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:GigaSpacesNamespaceHandler.java

示例13: getCacheProviderFacadeParser

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
protected BeanDefinitionParser getCacheProviderFacadeParser() {
   return cacheProviderFacadeParser;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:CacheonixNamespaceHandler.java

示例14: init

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
@Override
public void init() {
	registerBeanDefinitionParser("config", (BeanDefinitionParser)new NatsConfigBeanDefinitionParser());		
}
 
开发者ID:tyagihas,项目名称:spring_nats,代码行数:5,代码来源:NatsNamespaceHandler.java

示例15: getNameSpaceHandlerRegistry

import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
/**
 * @return the nameSpaceHandlerRegistry
 */
public static Map<String, BeanDefinitionParser> getNameSpaceHandlerRegistry() {
	return nameSpaceHandlerRegistry;
}
 
开发者ID:bigtester,项目名称:automation-test-engine,代码行数:7,代码来源:XsdNameSpaceParserRegistry.java


注:本文中的org.springframework.beans.factory.xml.BeanDefinitionParser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。