Package org.jboss.forge.parser.java

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();
         entity.addAnnotation(XmlRootElement.class);

         JavaClass endpoint = JavaParser.parse(JavaClass.class,
                  getClass().getResourceAsStream("/org/jboss/forge/rest/Endpoint.jv"));
         endpoint.setPackage(java.getBasePackage() + ".rest");
View Full Code Here


      List<JavaResource> entities  = new ArrayList<JavaResource>()// for RestGeneratedResources event
      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, "Skipped class [" + entity.getQualifiedName() + "] because @Id type [" + idType
View Full Code Here

      javaClass.setPackage(java.calculatePackage(resource));

      if (BeanScope.CUSTOM == scope)
      {
         String annoType = prompt.promptCommon("Enter the qualified custom scope type:", PromptType.JAVA_CLASS);
         javaClass.addAnnotation(annoType);
      }
      else if (BeanScope.DEPENDENT != scope)
      {
         javaClass.addAnnotation(scope.getAnnotation());
      }
View Full Code Here

         String annoType = prompt.promptCommon("Enter the qualified custom scope type:", PromptType.JAVA_CLASS);
         javaClass.addAnnotation(annoType);
      }
      else if (BeanScope.DEPENDENT != scope)
      {
         javaClass.addAnnotation(scope.getAnnotation());
      }
      java.saveJavaSource(javaClass);
      pickup.fire(new PickupResource(java.getJavaResource(javaClass)));
   }
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.