Package org.jboss.forge.roaster.model.source

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


      constraint.addAnnotationElement("Class<? extends Payload>[] payload() default { }");

      // Add nested annotation
      JavaAnnotationSource listNestedAnnotation = constraint.addNestedType(JavaAnnotationSource.class);
      listNestedAnnotation.setName("List");
      listNestedAnnotation.addAnnotation(Retention.class).setEnumValue(RUNTIME);
      listNestedAnnotation.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE, ANNOTATION_TYPE,
               CONSTRUCTOR);
      listNestedAnnotation.addAnnotationElement(constraint.getName() + "[] value()");
      return constraint;
   }
View Full Code Here

      // Add nested annotation
      JavaAnnotationSource listNestedAnnotation = constraint.addNestedType(JavaAnnotationSource.class);
      listNestedAnnotation.setName("List");
      listNestedAnnotation.addAnnotation(Retention.class).setEnumValue(RUNTIME);
      listNestedAnnotation.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE, ANNOTATION_TYPE,
               CONSTRUCTOR);
      listNestedAnnotation.addAnnotationElement(constraint.getName() + "[] value()");
      return constraint;
   }
}
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.