本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例12: getCacheProviderFacadeParser
import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
protected BeanDefinitionParser getCacheProviderFacadeParser() {
return cacheProviderFacadeParser;
}
示例13: getCacheProviderFacadeParser
import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
protected BeanDefinitionParser getCacheProviderFacadeParser() {
return cacheProviderFacadeParser;
}
示例14: init
import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
@Override
public void init() {
registerBeanDefinitionParser("config", (BeanDefinitionParser)new NatsConfigBeanDefinitionParser());
}
示例15: getNameSpaceHandlerRegistry
import org.springframework.beans.factory.xml.BeanDefinitionParser; //导入依赖的package包/类
/**
* @return the nameSpaceHandlerRegistry
*/
public static Map<String, BeanDefinitionParser> getNameSpaceHandlerRegistry() {
return nameSpaceHandlerRegistry;
}