Examples of IAnnotationMetadata


Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }
 
  @Test
  public void testMethodIdentification() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.MethodIdentificationSubtype");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);

    Map<IMethod, Annotation> beanMethodAnnotations = metadata.getMethodLevelAnnotations(Bean.class.getName());
    assertEquals(8, beanMethodAnnotations.size());

    IMethod getInstanceNoArg = type.getMethod("getInstance", new String[0]);
    IMethod getInstanceObject = type.getMethod("getInstance", new String[] {"QObject;"});
    IMethod getInstanceString = type.getMethod("getInstance", new String[] {"QString;"});
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }

  @Test
  public void testAutowiredConstructor() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.AutowiredConstructorClass");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);

    Map<IMethod, Annotation> beanMethodAnnotations = metadata.getMethodLevelAnnotations(Autowired.class.getName());
    assertEquals(1, beanMethodAnnotations.size());
   
    IMethod constructor = type.getMethod("AutowiredConstructorClass", new String[] {"QString;"});
    Annotation annotation = beanMethodAnnotations.get(constructor);
    assertEquals(Autowired.class.getName(), annotation.getAnnotationClass());
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }

  @Test
  public void testAdvancedComponentScanCase() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.AdvancedComponentScanClass");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);

    Annotation annotationMetadata = metadata.getTypeLevelAnnotation(ComponentScan.class.getName());
    assertEquals(ComponentScan.class.getName(), annotationMetadata.getAnnotationClass());
   
    Set<AnnotationMemberValuePair> members = annotationMetadata.getMembers();
    assertEquals(1, members.size());
   
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }

  @Test
  public void testAdvancedComponentScanWithEmptyArrayCase() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.AdvancedComponentScanClassWithEmptyArray");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);

    Annotation annotationMetadata = metadata.getTypeLevelAnnotation(ComponentScan.class.getName());
    assertEquals(ComponentScan.class.getName(), annotationMetadata.getAnnotationClass());
   
    Set<AnnotationMemberValuePair> members = annotationMetadata.getMembers();
    assertEquals(0, members.size());
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

    IType type = JdtUtils.getJavaType(bean.getElementResource().getProject(), BeansModelUtils.getBeanClass(bean,
        null));

    // Get annotation meta data
    IAnnotationMetadata visitor = getAnnotationMetadata(bean, beansConfig.getElementResource().getProject(), type);

    if (visitor != null) {
      // Call the actual processing of the found annotations
      processFoundAnnotations(bean, beanMetadata, type, visitor, progressMonitor);
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

    // Check cache first
    if (metadataCache.containsKey(orginalType)) {
      return metadataCache.get(orginalType);
    }

    IAnnotationMetadata visitor = null;

    // JDT in Eclipse 3.4 supports annotation in the core model
//    if (SpringCoreUtils.isEclipseSameOrNewer(3, 4)) {
//      visitor = new JdtBasedAnnotationMetadata(orginalType);
//    }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }

  @Test
  public void testNoAnnotations() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.NoAnnotations");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);
   
    assertNull(metadata.getTypeLevelAnnotation(Configuration.class.getName()));
    assertEquals(0, metadata.getTypeLevelAnnotationClasses().size());
   
    assertEquals(0, metadata.getMethodLevelAnnotations(Bean.class.getName()).size());
    assertEquals(0, metadata.getFieldLevelAnnotations(Autowired.class.getName()).size());
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }

  @Test
  public void testSimpleConfigurationClass() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.SimpleConfigurationClass");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);

    Annotation annotation = metadata.getTypeLevelAnnotation(Configuration.class.getName());
    assertEquals(Configuration.class.getName(), annotation.getAnnotationClass());
   
    Set<AnnotationMemberValuePair> members = annotation.getMembers();
    assertEquals(0, members.size());
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }

  @Test
  public void testSimpleBeanClass() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.SimpleBeanClass");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);
   
    assertEquals(0, metadata.getTypeLevelAnnotationClasses().size());
   
    Map<IMethod, Annotation> annotations = metadata.getMethodLevelAnnotations(Bean.class.getName());
    assertEquals(1, annotations.size());
   
    IMethod method = type.getMethods()[0];
    Annotation annotation = annotations.get(method);
    assertEquals(Bean.class.getName(), annotation.getAnnotationClass());
View Full Code Here

Examples of org.springframework.ide.eclipse.core.java.annotation.IAnnotationMetadata

  }

  @Test
  public void testSimpleBeanClassWithAutowireAttribute() throws Exception {
    IType type = JdtUtils.getJavaType(project, "org.test.spring.SimpleBeanClassWithAttribute");
    IAnnotationMetadata metadata = getAnnotationMetadata(type);
   
    assertEquals(0, metadata.getTypeLevelAnnotationClasses().size());
   
    Map<IMethod, Annotation> annotations = metadata.getMethodLevelAnnotations(Bean.class.getName());
    assertEquals(1, annotations.size());
   
    IMethod method = type.getMethods()[0];
    Annotation annotation = annotations.get(method);
    assertEquals(Bean.class.getName(), annotation.getAnnotationClass());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.