Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.IAnnotationBinding


    return meth != null && ASTUtil.isAnnotationPresent(meth.getAnnotations(), MOCK);
  }

  public static boolean isReentrantMockMethod(final IMethodBinding meth)
  {
    IAnnotationBinding ann = ASTUtil.findAnnotation(meth.getAnnotations(), MOCK);

    if (ann != null)
    {
      for (IMemberValuePairBinding pair : ann.getDeclaredMemberValuePairs())
      {
        if ("reentrant".equals(pair.getName()))
        {
          return Boolean.valueOf(pair.getValue().toString());
        }
View Full Code Here


    return origMethod;
  }

  public static ITypeBinding findRealClassType(final ITypeBinding mockClass)
  {
    IAnnotationBinding ann = ASTUtil.findAnnotation(mockClass.getAnnotations(), MOCK_CLASS);

    for (IMemberValuePairBinding pair : ann.getDeclaredMemberValuePairs())
    {
      if ("realClass".equals(pair.getName()))
      {
        if (pair.getValue() instanceof ITypeBinding)
        {
View Full Code Here

  }
 
  public List<ICrystalAnnotation> getAnnotation(List<IExtendedModifier> modifiers) {
    ICrystalAnnotation crystalAnno;
    List<ICrystalAnnotation> annoList = new ArrayList<ICrystalAnnotation>();
    IAnnotationBinding binding;
   
    for (IExtendedModifier mod : modifiers) {
      if (!mod.isAnnotation())
        continue;
     
View Full Code Here

     
    //ok, now we have the array of annotations
    for (Expression exp : realAnnos ) {
      if (!(exp instanceof Annotation))
        throw err;
      IAnnotationBinding binding = ((Annotation)exp).resolveAnnotationBinding();
      crystalAnnos.add(db.createAnnotation(binding));
    }
    return crystalAnnos;
  }
View Full Code Here

    if (annoClass == null) {
      IAnnotationBinding[] metas = typeBinding.getAnnotations();
      // might still be a meta annotation. Check for this.
      for (int ndx = 0; ndx < metas.length && annoClass == null; ndx++) {
        IAnnotationBinding meta = metas[ndx];
        String metaName = meta.getAnnotationType().getQualifiedName();
        annoClass = metaQualNames.get(metaName);
      }
    }

    if (annoClass == null)
View Full Code Here

    if (annoClass == null) {
      IAnnotationBinding[] metas = typeBinding.getAnnotations();
      // might still be a meta annotation. Check for this.
      for (int ndx = 0; ndx < metas.length && annoClass == null; ndx++) {
        IAnnotationBinding meta = metas[ndx];
        String metaName = meta.getAnnotationType().getQualifiedName();
        annoClass = metaQualNames.get(metaName);
      }
    }

    if (annoClass == null)
View Full Code Here

  @Test
  public void testGetAnnotationValue() {
    IMocksControl control = createStrictControl();
   
    ITypeBinding binding = control.createMock(ITypeBinding.class);
    IAnnotationBinding anno = control.createMock(IAnnotationBinding.class);
    ITypeBinding typeBinding = control.createMock(ITypeBinding.class);
    IMemberValuePairBinding memberValue = control.createMock(IMemberValuePairBinding.class);
   
    expect(binding.getAnnotations()).andReturn(new IAnnotationBinding[] {anno});
    expect(anno.getAnnotationType()).andReturn(typeBinding);
    expect(typeBinding.getQualifiedName()).andReturn("java.lang.String");
    expect(anno.getAllMemberValuePairs()).andReturn(new IMemberValuePairBinding[] {memberValue});
    expect(memberValue.getName()).andReturn("value");
    expect(memberValue.getValue()).andReturn("Test-Annotation");
   
    control.replay();
   
View Full Code Here

    assertEquals("Comp1", mappingHelper.getComponentName(binding));
   
    reset(binding);
   
    // Last test is with an annotation value
    IAnnotationBinding annoBinding = createMock(IAnnotationBinding.class);
    ITypeBinding annoTypeBinding = createMock(ITypeBinding.class);
    IMemberValuePairBinding memberValuePairBinding = createMock(IMemberValuePairBinding.class);
    IPackageBinding packageBinding = createMock(IPackageBinding.class);
   
    expect(binding.getQualifiedName()).andReturn("de.supertest.TestClass");
    expect(binding.getAnnotations()).andReturn(new IAnnotationBinding[] {annoBinding});
    expect(annoBinding.getAnnotationType()).andReturn(annoTypeBinding);
    expect(annoTypeBinding.getQualifiedName()).andReturn(BelongsToComponent.class.getCanonicalName());
    expect(annoBinding.getAllMemberValuePairs()).andReturn(new IMemberValuePairBinding[]
                             { memberValuePairBinding });
    expect(memberValuePairBinding.getName()).andReturn("value");
    expect(memberValuePairBinding.getValue()).andReturn("Comp1");
   
    expect(binding.getName()).andReturn("TestClass");
View Full Code Here

      boolean hasTestNGAnnotation = false;
      List<IExtendedModifier> modifiers = md.modifiers();
      for (IExtendedModifier m : modifiers) {
        if (m.isAnnotation()) {
          Annotation a = (Annotation) m;
          IAnnotationBinding ab = a.resolveAnnotationBinding();
          String typeName = ab.getAnnotationType().getBinaryName();
          if (typeName.contains("org.testng")) {
            hasTestNGAnnotation = true;
            break;
          }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.IAnnotationBinding

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.