Java 类org.springframework.beans.factory.parsing.ParseState 实例源码

项目:txnmgr-springframework-ext    文件:TransactionManagerBeanDefinitionParser.java   
@Override
protected void doParse(Element element, ParserContext parserContext,
        BeanDefinitionBuilder builder) {
    this.parserContext = parserContext;
    this.parseState = new ParseState();

    String name = element.getAttribute(NAME_ATTRIBUTE);
    BeanDefinition grpRegistryDef = createGroupRegistryDefinition(name,
            element);

    AbstractBeanDefinition txMgrBeanDefinition = builder
            .getBeanDefinition();

    // Bean creation is delegated to a factory
    txMgrBeanDefinition.setFactoryBeanName(element
            .getAttribute(FACTORY_BEAN_ATTRIBUTE));

    if (element.hasAttribute(FACTORY_METHOD_ATTRIBUTE)) {
        txMgrBeanDefinition.setFactoryMethodName(element
                .getAttribute(FACTORY_METHOD_ATTRIBUTE));
    } else {
        txMgrBeanDefinition
                .setFactoryMethodName(DEFAULT_FACTORY_METHOD_NAME);
    }

    // Factory creation method expects 2 arguments :
    // * arg n�1 : transaction manager name
    // * arg n�2 : a ParticipantsGroupRegistry instance
    ConstructorArgumentValues cav = txMgrBeanDefinition
            .getConstructorArgumentValues();
    cav.addGenericArgumentValue(name);
    cav.addGenericArgumentValue(grpRegistryDef);
}
项目:gemini.blueprint    文件:BlueprintParser.java   
public BlueprintParser(ParseState parseState, Collection<String> usedNames) {
    this.parseState = (parseState != null ? parseState : new ParseState());
    this.usedNames = (usedNames != null ? usedNames : new LinkedHashSet<String>());
}