Package org.springframework.beans.factory.support

Examples of org.springframework.beans.factory.support.BeanDefinitionRegistry


* @version $Rev: 987670 $ $Date: 2010-08-20 16:42:07 -0700 (Fri, 20 Aug 2010) $
*/
public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAPropertyElement propertyElement =
                new SpringSCAPropertyElement(element.getAttributeNS(null, "name"), element.getAttributeNS(null, "type"));
            context.addSCAPropertyElement(propertyElement);
View Full Code Here


* @version $Rev: 988747 $ $Date: 2010-08-24 15:34:52 -0700 (Tue, 24 Aug 2010) $
*/
public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAReferenceElement referenceElement =
                new SpringSCAReferenceElement(getAttribute(element, "name"), getAttribute(element, "type"));
            referenceElement.setDefaultBean(getAttribute(element, "default"));
View Full Code Here

* @version $Rev: 988747 $ $Date: 2010-08-24 15:34:52 -0700 (Tue, 24 Aug 2010) $
*/
public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {

    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        if (registry instanceof SCAGenericApplicationContext) {
            SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
            SpringSCAServiceElement serviceElement =
                new SpringSCAServiceElement(getAttribute(element, "name"), getAttribute(element, "target"));
            serviceElement.setType(getAttribute(element, "type"));
View Full Code Here

  private AnnotationBeanNameGenerator beanNameGenerator = new AnnotationBeanNameGenerator();


  public void testGenerateBeanNameWithNamedComponent() {
    MockControl control = MockControl.createControl(BeanDefinitionRegistry.class);
    BeanDefinitionRegistry registry = (BeanDefinitionRegistry) control.getMock();
    control.replay();

    AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithName.class);
    String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
    assertNotNull("The generated beanName must *never* be null.", beanName);
View Full Code Here

    control.verify();
  }

  public void testGenerateBeanNameWithDefaultNamedComponent() {
    MockControl control = MockControl.createControl(BeanDefinitionRegistry.class);
    BeanDefinitionRegistry registry = (BeanDefinitionRegistry) control.getMock();
    control.replay();

    AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(DefaultNamedComponent.class);
    String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
    assertNotNull("The generated beanName must *never* be null.", beanName);
View Full Code Here

    control.verify();
  }

  public void testGenerateBeanNameWithNamedComponentWhereTheNameIsBlank() {
    MockControl control = MockControl.createControl(BeanDefinitionRegistry.class);
    BeanDefinitionRegistry registry = (BeanDefinitionRegistry) control.getMock();
    control.replay();

    AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithBlankName.class);
    String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
    assertNotNull("The generated beanName must *never* be null.", beanName);
View Full Code Here

    control.verify();
  }

  public void testGenerateBeanNameWithAnonymousComponentYieldsGeneratedBeanName() {
    MockControl control = MockControl.createControl(BeanDefinitionRegistry.class);
    BeanDefinitionRegistry registry = (BeanDefinitionRegistry) control.getMock();
    control.replay();

    AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(AnonymousComponent.class);
    String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
    assertNotNull("The generated beanName must *never* be null.", beanName);
View Full Code Here

    private static final Log log = LogFactory.getLog(ProxyParser.class);

    public BeanDefinition parse(Element proxyElement, ParserContext parserContext)
    {
        String beanRef = proxyElement.getAttribute("bean");
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        BeanDefinition beanRefDefinition = findParentDefinition(beanRef, registry);
        String javascript = proxyElement.getAttribute("javascript");
        if (!StringUtils.hasText(javascript))
        {
            javascript = StringUtils.capitalize(beanRef);
View Full Code Here

{

    public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder parent, ParserContext parserContext)
    {
        Element element = (Element) node;
        BeanDefinitionRegistry registry = parserContext.getRegistry();

        String type = element.getAttribute("type");
        if ("preconfigured".equals(type))
        {
            type += ":" + element.getAttribute("ref");
View Full Code Here

    public BeanDefinitionHolder decorate(Node filterElement, BeanDefinitionHolder parent, ParserContext parserContext)
    {
        String name = parent.getBeanName();
        Element element = (Element) filterElement;
        BeanDefinitionRegistry registry = parserContext.getRegistry();
        processFilter(registry, element, name);
        addGlobalFilter(registry, element, name);
        return parent;
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.support.BeanDefinitionRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.