/** * Add the visitors, associated with this Bean instance, to the visitor map. * @param visitorMap The visitor Map. */ public void addVisitors(VisitorConfigMap visitorMap) { // Need to protect against multiple calls. This can happen where e.g. beans are // wired together in 2-way relationships, or the creating code doesn't use the // fluent interface and calls Smooks.addVisitor to each bean instance. if(processed) { return; } processed = true; // Add the create bean visitor... SmooksResourceConfiguration creatorConfig = visitorMap.addVisitor(beanInstanceCreator, createOnElement, targetNamespace, true); creatorConfig.setParameter("beanId", getBeanId()); creatorConfig.setParameter("beanClass", beanClass.getName()); // Recurse down the wired beans... for(Bean bean : wirings) { bean.addVisitors(visitorMap); } // Add the populate bean visitors... for(Binding binding : bindings) { SmooksResourceConfiguration populatorConfig = visitorMap.addVisitor(binding.beanInstancePopulator, binding.selector, targetNamespace, true); populatorConfig.setParameter("beanId", getBeanId()); if(binding.assertTargetIsCollection) { assertBeanClassIsCollection(); } } }
/** * Add the visitors, associated with this Bean instance, to the visitor map. * @param visitorMap The visitor Map. */ public void addVisitors(VisitorConfigMap visitorMap) { // Need to protect against multiple calls. This can happen where e.g. beans are // wired together in 2-way relationships, or the creating code doesn't use the // fluent interface and calls Smooks.addVisitor to each bean instance. if(processed) { return; } processed = true; // Add the create bean visitor... SmooksResourceConfiguration creatorConfig = visitorMap.addVisitor(beanInstanceCreator, createOnElement, targetNamespace, true); creatorConfig.setParameter("beanId", getBeanId()); creatorConfig.setParameter("beanClass", beanClass.getName()); // Recurse down the wired beans... for(Bean bean : wirings) { bean.addVisitors(visitorMap); } // Add the populate bean visitors... for(Binding binding : bindings) { SmooksResourceConfiguration populatorConfig = visitorMap.addVisitor(binding.beanInstancePopulator, binding.selector, targetNamespace, true); populatorConfig.setParameter("beanId", getBeanId()); if(binding.assertTargetIsCollection) { assertBeanClassIsCollection(); } } }
/** * Add the visitors, associated with this Bean instance, to the visitor map. * @param visitorMap The visitor Map. */ public void addVisitors(VisitorConfigMap visitorMap) { // Need to protect against multiple calls. This can happen where e.g. beans are // wired together in 2-way relationships, or the creating code doesn't use the // fluent interface and calls Smooks.addVisitor to each bean instance. if(processed) { return; } processed = true; // Add the create bean visitor... SmooksResourceConfiguration creatorConfig = visitorMap.addVisitor(beanInstanceCreator, createOnElement, targetNamespace, true); creatorConfig.setParameter("beanId", getBeanId()); creatorConfig.setParameter("beanClass", beanClass.getName()); // Recurse down the wired beans... for(Bean bean : wirings) { bean.addVisitors(visitorMap); } // Add the populate bean visitors... for(Binding binding : bindings) { SmooksResourceConfiguration populatorConfig = visitorMap.addVisitor(binding.beanInstancePopulator, binding.selector, targetNamespace, true); populatorConfig.setParameter("beanId", getBeanId()); if(binding.assertTargetIsCollection) { assertBeanClassIsCollection(); } } }