Package org.springframework.ide.eclipse.beans.core.model

Examples of org.springframework.ide.eclipse.beans.core.model.IBean


   
    return null;
  }
 
  private ISourceModelElement getModelElementForCustomConverter(IFile file, String customConverterId) {
    IBean bean = DozerPluginUtils.getDozerBeanForMappingFile(file);
    BeansMapEntry modelElement = DozerPluginUtils.getCCIModelElementForMappingFile(bean, customConverterId);

    if (modelElement != null)
      return modelElement;
View Full Code Here


    int offset = nodeAtOffset.getStartOffset()+nodeAtOffset.getNodeName().length()+2;
    int len = nodeAtOffset.getLength()-nodeAtOffset.getNodeName().length()-3;
   
    ContentAssistRequest contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, offset, len, matchString);
    IFile file = BeansEditorUtils.getFile(this.fTextViewer.getDocument());
    IBean bean = DozerPluginUtils.getDozerBeanForMappingFile(file);
    IModelElement[] ccwiPropertyMapEntries = DozerPluginUtils.getPossibleCCIMappingForMappingFile(bean);
   
    if (ccwiPropertyMapEntries != null) {
      for (IModelElement beansMapEntry : ccwiPropertyMapEntries) {
        BeansMapEntry entry = (BeansMapEntry)beansMapEntry;
View Full Code Here

      return null;
  }
 
  public static IBean getDozerBeanForMappingFile(IFile mappingIFile) {
    Set<IBean> beans = new HashSet<IBean>();
    IBean returnBean = null;
   
    //The mapping file that we are in
    File mappingFile = new File(mappingIFile.getName());
    String mappingFileName = mappingFile.getName();
   
View Full Code Here

     
      return null;
  }
 
  public static String getClassNameForCCI(IFile mappingIFile, String customConverterId) {   
    IBean bean = getDozerBeanForMappingFile(mappingIFile);
   
    if (bean == null)
      return null;
   
    BeansMapEntry beansMapEntry = getCCIModelElementForMappingFile(bean, customConverterId);

    if (beansMapEntry != null) {
      if (beansMapEntry.getValue() instanceof Bean) {
        Bean cciBean = (Bean)beansMapEntry.getValue();
        return cciBean.getBeanDefinition().getBeanClassName();
      } else if (beansMapEntry.getValue() instanceof BeanReference) {
        BeanReference beanRef = (BeanReference)beansMapEntry.getValue();       
        String beanName = beanRef.getBeanName();
       
        Set<IBeansProject> projects = BeansCorePlugin.getModel().getProjects();
        for (IBeansProject beansProject : projects) {
          Set<IBeansConfig> tempConfigs = beansProject.getConfigs();
          for (IBeansConfig config : tempConfigs) {
            IBean foundBean = config.getBean(beanName);
            if (foundBean != null) {
              return foundBean.getClassName();
            }
          }
        }
      }
    }
View Full Code Here

    IType configClass = javaProject.findType("org.test.spring.SimpleConfigurationClass");
    BeansJavaConfig config = new BeansJavaConfig(beansProject, configClass, "org.test.spring.SimpleConfigurationClass", IBeansConfig.Type.MANUAL);
   
    assertEquals("java:org.test.spring.SimpleConfigurationClass", config.getElementName());
   
    IBean configBean = BeansModelUtils.getBean("simpleConfigurationClass", config);
    assertEquals("simpleConfigurationClass", configBean.getElementName());
   
    IBean bean = BeansModelUtils.getBean("simpleScannedBean", config);
    assertEquals("simpleScannedBean", bean.getElementName());

    IBean processor1 = BeansModelUtils.getBean(AnnotationConfigUtils.CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor1);
   
    IBean processor2 = BeansModelUtils.getBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor2);

    IBean processor3 = BeansModelUtils.getBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor3);
   
    IBean processor4 = BeansModelUtils.getBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor4);
   
    IBean processor5 = BeansModelUtils.getBean(AnnotationConfigUtils.PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor5);

    Set<IBean> beans = BeansModelUtils.getBeans(config);
    assertEquals(7, beans.size());
View Full Code Here

    IType configClass = javaProject.findType("org.test.advanced.AdvancedConfigurationClass");
    BeansJavaConfig config = new BeansJavaConfig(beansProject, configClass, "org.test.advanced.AdvancedConfigurationClass", IBeansConfig.Type.MANUAL);
   
    assertEquals("java:org.test.advanced.AdvancedConfigurationClass", config.getElementName());

    IBean simpleBean = BeansModelUtils.getBean("simpleScannedBean", config);
    assertEquals("simpleScannedBean", simpleBean.getElementName());

    IBean bean = BeansModelUtils.getBean("advancedConfigurationClass", config);
    assertEquals("advancedConfigurationClass", bean.getElementName());
   
    IBean transactionBean = BeansModelUtils.getBean("org.springframework.transaction.config.internalTransactionAdvisor", config);
    assertEquals("org.springframework.transaction.config.internalTransactionAdvisor", transactionBean.getElementName());

    IBean aspectjBean = BeansModelUtils.getBean("org.springframework.aop.config.internalAutoProxyCreator", config);
    assertNotNull(aspectjBean);
    assertEquals("org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator", aspectjBean.getClassName());
  }
View Full Code Here

  @Test
  public void testComponentScanningWithProfile() throws Exception {
    IType configClass = javaProject.findType("org.test.profile.ProfileConfigurationClass");
    BeansJavaConfig config = new BeansJavaConfig(beansProject, configClass, "org.test.profile.ProfileConfigurationClass", IBeansConfig.Type.MANUAL);
   
    IBean simpleBean = BeansModelUtils.getBean("simpleScannedBean", config);
    assertEquals("simpleScannedBean", simpleBean.getElementName());

    IBean configClassBean = BeansModelUtils.getBean("profileConfigurationClass", config);
    assertEquals("profileConfigurationClass", configClassBean.getElementName());
   
    assertEquals(1, getProfiles(simpleBean).size());
    assertEquals("testProfile", getProfiles(simpleBean).iterator().next());
   
    assertEquals(0, getProfiles(configClassBean).size());
View Full Code Here

      if (pattern.matcher(alias.getBeanName()).matches()) {
        return true;
      }
    }
    else if (element instanceof IBean) {
      IBean bean = (IBean) element;

      // Compare reference with parent bean
      if (bean.isChildBean()
          && pattern.matcher(bean.getParentName()).matches()) {
        return true;
      }
      AbstractBeanDefinition bd = (AbstractBeanDefinition)
          ((Bean) element).getBeanDefinition();
View Full Code Here

      model = XmlQuickFixUtil.getModel(marker);
      Element legacyXmlElement = XmlQuickFixUtil.getMarkerElement(model, marker);

      insertNamespaceDeclaration(model);

      IBean jndiObjectFactoryBean = (IBean) BeansCorePlugin.getModel().getElement(
          marker.getAttribute("elementId", ""));

      Element namespaceJndiElement = createNamespaceSyntaxXmlElement(jndiObjectFactoryBean,
          NAMESPACE_JNDI_ELEMENT_NAME, legacyXmlElement.getOwnerDocument());
View Full Code Here

    // Create beans from wrapped bean definitions
    for (BeanDefinition beanDef : definition.getBeanDefinitions()) {
      if (beanDef instanceof AbstractBeanDefinition) {
        String beanName = UniqueBeanNameGenerator.generateBeanName(beanDef, config);
        IBean bean = new Bean(component, beanName, null, beanDef);
        component.addBean(bean);
      }
    }

    // Create components or beans from nested component definitions
    if (definition instanceof CompositeComponentDefinition) {
      for (ComponentDefinition compDef : ((CompositeComponentDefinition) definition).getNestedComponents()) {
        if (compDef instanceof CompositeComponentDefinition || compDef.getBeanDefinitions().length > 1) {
          component.addComponent(createComponent(component, config, compDef));
        }
        else {
          IBean bean = createBean(component, compDef);
          if (bean != null) {
            component.addBean(bean);
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.core.model.IBean

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.