Package org.springframework.ide.eclipse.beans.core.autowire.internal.provider

Examples of org.springframework.ide.eclipse.beans.core.autowire.internal.provider.AutowireDependencyProvider$AutowireProblemReporter


  /**
   * Pass all {@link ValidationProblem}s that are stored in given {@link BeansConfig} into the <code>context</code>.
   */
  public void validate(IBeansConfig element, IBeansValidationContext context, IProgressMonitor monitor) {
    AutowireDependencyProvider provider = new AutowireDependencyProvider(element, (IBeansModelElement) context
        .getContextElement());
    provider.setProjectClassLoaderSupport(context.getProjectClassLoaderSupport());
   
    provider.resolveAutowiredDependencies();
    for (ValidationProblem problem : provider.getValidationProblems()) {
      context.addProblems(problem);
    }
  }
View Full Code Here


  }

  // public for testing
  public void addHyperlinksHelper(IBeansConfig config, final String typeName, final IProject project,
      final Set<AutowireBeanHyperlink> hyperlinks) {
    final AutowireDependencyProvider autowireDependencyProvider = new AutowireDependencyProvider(config, config);
    final String[][] beanNamesWrapper = new String[1][];

    try {
      IProjectClassLoaderSupport classLoaderSupport = JdtUtils.getProjectClassLoaderSupport(project.getProject(),
          null);
      autowireDependencyProvider.setProjectClassLoaderSupport(classLoaderSupport);
      classLoaderSupport.executeCallback(new IProjectClassLoaderAwareCallback() {
        public void doWithActiveProjectClassLoader() throws Throwable {
          autowireDependencyProvider.preloadClasses();
          beanNamesWrapper[0] = autowireDependencyProvider.getBeansForType(typeName);
        }
      });
    }
    catch (Throwable e) {
      BeansCorePlugin.log(e);
    }

    String[] beanNames = beanNamesWrapper[0];
    for (final String beanName : beanNames) {
      IBean bean = autowireDependencyProvider.getBean(beanName);
      final IResource resource = bean.getElementResource();
      final int line = bean.getElementStartLine();
      if (resource instanceof IFile) {
        AutowireBeanHyperlink newHyperlink = new AutowireBeanHyperlink((IFile) resource, line, beanName);
        boolean found = false;
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void addAdditionalBeans(Map<String, Bean> beans, List<Reference> beansReferences, IBeansModelElement root,
      IBeansModelElement context) {
    AutowireDependencyProvider provider = new AutowireDependencyProvider(root, context);
    Map<IBean, Set<IBeanReference>> autowiredReferences = provider.resolveAutowiredDependencies();

    for (Map.Entry<IBean, Set<IBeanReference>> entry : autowiredReferences.entrySet()) {
      Bean bean = beans.get(entry.getKey().getElementName());
      if (bean != null) {
        Set<String> autowiredProperties = new HashSet<String>();
View Full Code Here

    Map<String, Integer[]> allowedRefs = new HashMap<String, Integer[]>();
    allowedRefs.put("testBean", new Integer[] { 70 });
    allowedRefs.put("testBean2", new Integer[] { 110 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertTrue(references.size() == 1);
    assertTrue(references.containsKey(bean));
View Full Code Here

    allowedRefs.put("testBean3", new Integer[] { 148 });
    allowedRefs.put("testBean4", new Integer[] { 130 });
    allowedRefs.put("xy", new Integer[] { 135, 153, 236 });
    allowedRefs.put("beanFactory", new Integer[] { 140 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertTrue(references.size() == 2);
    assertTrue(references.containsKey(bean));
View Full Code Here

    allowedRefs.put("testBean3", new Integer[] { 148 });
    allowedRefs.put("testBean4", new Integer[] { 130 });
    allowedRefs.put("xy", new Integer[] { 135, 153 });
    allowedRefs.put("beanFactory", new Integer[] { 140 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

   
    assertTrue(references.size() == 1);
    assertTrue(references.containsKey(bean));
View Full Code Here

    allowedRefs.put("testBean3", new Integer[] { 201 });
    allowedRefs.put("testBean4", new Integer[] { 183 });
    allowedRefs.put("xy", new Integer[] { 188, 206 });
    allowedRefs.put("beanFactory", new Integer[] { 193 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertTrue(references.size() == 1);
    assertTrue(references.containsKey(bean));
View Full Code Here

    BeansConfig config = new BeansConfig(beansProject, "src/org/springframework/beans/factory/annotation/testResourceInjection-context.xml", IBeansConfig.Type.MANUAL);
   
    Map<String, Integer[]> allowedRefs = new HashMap<String, Integer[]>();
    allowedRefs.put("testBean", new Integer[] { 42, 48 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertEquals(1, references.size());
    assertTrue(references.containsKey(bean));
View Full Code Here

    Map<String, Integer[]> allowedRefs = new HashMap<String, Integer[]>();
    allowedRefs.put("testBean", new Integer[] { 42, 68, 82, 87, 93 });
    allowedRefs.put("nestedTestBean", new Integer[] { 87 });
    allowedRefs.put("beanFactory", new Integer[] { 98 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertEquals(1, references.size());
    assertTrue(references.containsKey(bean));
View Full Code Here

    Map<String, Integer[]> allowedRefs = new HashMap<String, Integer[]>();
    allowedRefs.put("testBean", new Integer[] { 42, 68, 87, 93 });
    allowedRefs.put("nestedTestBean", new Integer[] { 87 });
    allowedRefs.put("beanFactory", new Integer[] { 98 });
   
    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertEquals(1, references.size());
    assertTrue(references.containsKey(bean));
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.core.autowire.internal.provider.AutowireDependencyProvider$AutowireProblemReporter

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.