Examples of addAnnotation()


Examples of org.jboss.ejb3.aop.annotation.CachingAnnotationRepository.addAnnotation()

      AnnotationRepository repository = new CachingAnnotationRepository(delegate, classLoader);
     
      Method member = beanClass.getDeclaredMethod("sayHi", String.class);
      String annotation = "javax.interceptor.Interceptors";
      String value = "@javax.interceptor.Interceptors (value={" + DummyInterceptor.class.getName() + ".class})";
      repository.addAnnotation(member, annotation, value);
     
      Interceptors interceptors = (Interceptors) repository.resolveAnnotation(member, Interceptors.class);
      assertArrayEquals(new Class[] { DummyInterceptor.class }, interceptors.value());
   }
}
View Full Code Here

Examples of org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData.addAnnotation()

      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      AnnotationRepositoryToMetaData repository = new AnnotationRepositoryToMetaData(TwoLifecycleMethodsBean.class, beanMetaData, canonicalObjectName, classLoader);
     
      Method method = Dummy.class.getDeclaredMethod("dummyMethod");
      Annotation annotation = new ResourceImpl();
      repository.addAnnotation(method, Resource.class, annotation);
     
      assertTrue("Failed to find annotation @Resource on " + method, repository.hasAnnotation(method, Resource.class));
   }
}
View Full Code Here

Examples of org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.addAnnotation()

            public Class<? extends Annotation> annotationType() {
              return PackageTarget.class;
            }
          };

          uiBinderBoilerPlaterIface.addAnnotation(handler);
          uiBinderBoilerPlaterIface.addAnnotation(packageTarget);

          context.getBootstrapClass().addInnerClass(new InnerClass(uiBinderBoilerPlaterIface));

          String varName = "uiBinderInst_" + injectionPoint.getEnclosingType().getFullyQualifiedName()
View Full Code Here

Examples of org.jboss.forge.parser.java.JavaAnnotation.addAnnotation()

         type.setPackage(pckg);
      }

      if (documented)
      {
         type.addAnnotation(Documented.class);
      }
      if (retentionPolicy != null)
      {
         type.addAnnotation(Retention.class).setEnumValue(retentionPolicy);
      }
View Full Code Here

Examples of org.jboss.forge.parser.java.JavaClass.addAnnotation()

      final JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
      for (JavaResource jr : javaTargets)
      {
         JavaClass entity = (JavaClass) (jr).getJavaSource();
         if (!entity.hasAnnotation(XmlRootElement.class))
            entity.addAnnotation(XmlRootElement.class);

         String idType = resolveIdType(entity);
         if (!Types.isBasicType(idType))
         {
            ShellMessages.error(out, "Skipping class because @Id type [" + idType + "] is not supported by endpoint generation.");
View Full Code Here

Examples of org.jboss.forge.parser.java.JavaPackageInfo.addAnnotation()

      List<ValuePair> values = annotation.getValues();
      Assert.assertEquals(3, values.size());
      String namespace = annotation.getLiteralValue("namespace");
      Assert.assertEquals(namespace, "\"http://forge.org/Test\"");
     
      Annotation<JavaPackageInfo> annotationXmlOrder = javaPkg.addAnnotation("javax.xml.bind.annotation.XmlAccessorOrder");
      Annotation<JavaPackageInfo> annotationXmlAccessorOrder = javaPkg.getAnnotation("XmlAccessorOrder");
      Assert.assertEquals(annotationXmlOrder.getName(), annotationXmlAccessorOrder.getName());
     
   }
}
View Full Code Here

Examples of org.jboss.forge.roaster.model.source.JavaAnnotationSource.addAnnotation()

   {
      Project project = projectHelper.createJavaLibraryProject();
      projectHelper.installCDI_1_0(project);
      JavaAnnotationSource ann = Roaster.create(JavaAnnotationSource.class).setName("MyCustomScope")
               .setPackage("org.jboss.forge.test.scope");
      ann.addAnnotation(NormalScope.class);
      project.getFacet(JavaSourceFacet.class).saveJavaSource(ann);
      CommandController controller = testHarness.createCommandController(NewBeanCommand.class,
               project.getRoot());
      controller.initialize();
      controller.setValueFor("named", "MyCustomServiceBean");
View Full Code Here

Examples of org.jboss.forge.roaster.model.source.JavaClassSource.addAnnotation()

   {
      JavaClassSource entity = context.getEntity();
      Project project = context.getProject();
      if (!entity.hasAnnotation(XmlRootElement.class))
      {
         entity.addAnnotation(XmlRootElement.class);
         project.getFacet(JavaSourceFacet.class).saveJavaSource(entity);
      }
      String contentType = ResourceGeneratorUtil.getContentType(context.getContentType());
      String idType = JPAEntityUtil.resolveIdType(entity);
      String persistenceUnitName = context.getPersistenceUnitName();
View Full Code Here

Examples of org.jboss.forge.roaster.model.source.JavaPackageInfoSource.addAnnotation()

      List<ValuePair> values = annotation.getValues();
      Assert.assertEquals(3, values.size());
      String namespace = annotation.getLiteralValue("namespace");
      Assert.assertEquals(namespace, "\"http://forge.org/Test\"");

      AnnotationSource<JavaPackageInfoSource> annotationXmlOrder = javaPkg
               .addAnnotation("javax.xml.bind.annotation.XmlAccessorOrder");
      AnnotationSource<JavaPackageInfoSource> annotationXmlAccessorOrder = javaPkg.getAnnotation("XmlAccessorOrder");
      Assert.assertEquals(annotationXmlOrder.getName(), annotationXmlAccessorOrder.getName());
   }
}
View Full Code Here

Examples of org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader.addAnnotation()

      if (delegate == null)
      {
         delegate = new MemoryMetaDataLoader(getThreadScopeKey(), false, true);
         threadLocal.set(delegate);
      }
      return delegate.addAnnotation(annotation);
   }
  
   public <T extends Annotation> T removeAnnotation(Class<T> annotationType)
   {
      MemoryMetaDataLoader delegate = threadLocal.get();
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.