Package org.jboss.forge.addon.parser.java.facets

Examples of org.jboss.forge.addon.parser.java.facets.JavaSourceFacet.saveJavaSource()


      JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
      for (String enumConstant : arguments.getValue())
      {
         source.addEnumConstant(enumConstant);
      }
      facet.saveJavaSource(source);
      return Results.success();
   }

   @Override
   protected boolean isProjectRequired()
View Full Code Here


      }
      else
      {
         final JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
         JavaClass javaClass = createCommand(named.getValue(), targetPackage.getValue(), categories.getValue());
         javaResource = java.saveJavaSource(javaClass);
      }
      context.getUIContext().setSelection(javaResource);
      return Results.success("Command " + javaResource + " created");
   }
View Full Code Here

      facetFactory.install(project, DefaultFurnaceContainerFacet.class);
      facetFactory.install(project, CDIFacet_1_1.class);
      facetFactory.install(project, AddonTestFacet.class);

      JavaSourceFacet javaSource = project.getFacet(JavaSourceFacet.class);
      javaSource.saveJavaSource(JavaParser.create(JavaPackageInfo.class).setPackage(javaSource.getBasePackage()));

      installSelectedAddons(project, dependencyAddons, false);
   }

   /**
 
View Full Code Here

               DependencyBuilder.create(spiProjectDependency).setVersion("${project.version}"));

      for (Project p : Arrays.asList(addonProject, apiProject, implProject, spiProject))
      {
         JavaSourceFacet javaSource = p.getFacet(JavaSourceFacet.class);
         javaSource.saveJavaSource(JavaParser.create(JavaPackageInfo.class).setPackage(
                  project.getFacet(MetadataFacet.class).getTopLevelPackage()));
      }

      installSelectedAddons(project, dependencyAddons, true);
      installSelectedAddons(addonProject, dependencyAddons, false);
View Full Code Here

         }
         scope.addAnnotation(Retention.class).setEnumValue(RUNTIME);
         scope.addAnnotation(Target.class).setEnumValue(TYPE, METHOD, FIELD);
         scope.addAnnotation(Documented.class);

         javaSourceFacet.saveJavaSource(scope);
      }
      return result;
   }

   @Override
View Full Code Here

         }
         else if (BeanScope.DEPENDENT != scopedValue)
         {
            javaSource.addAnnotation(scopedValue.getAnnotation());
         }
         javaSourceFacet.saveJavaSource(javaSource);
      }
      return result;
   }

   @Override
View Full Code Here

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      List<JavaResource> selection = new ArrayList<>();

      for (JavaClass javaClass : endpoints)
      {
         selection.add(javaSourceFacet.saveJavaSource(javaClass));
      }
      uiContext.setSelection(selection);
      return Results.success("Endpoint created");
   }
View Full Code Here

      Project project = getSelectedProject(uiContext);
      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      JavaResource javaResource = context.getUIContext().getSelection();
      JavaSource<?> javaSource = javaResource.getJavaSource();
      javaSource.addAnnotation(MappedSuperclass.class);
      javaResource = javaSourceFacet.saveJavaSource(javaSource);
      uiContext.setSelection(javaResource);
      return result;
   }
}
View Full Code Here

            final boolean serializable
            ) throws FileNotFoundException
   {
      final JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
      JavaClass javaClass = createJavaClass(ejbName, targetPackage, ejbType, serializable);
      return java.saveJavaSource(javaClass);
   }

   /**
    * Creates a new {@link JavaResource} in the specified target. If a project is available, use
    * {@link EJBOperations#newEntity(Project, String, String, GenerationType)}
View Full Code Here

   {
      Project selectedProject = getSelectedProject(context);
      if (selectedProject != null)
      {
         JavaSourceFacet facet = selectedProject.getFacet(JavaSourceFacet.class);
         facet.saveJavaSource(field.getOrigin());
      }
      context.getUIContext().setSelection(javaResource);
   }

   @Override
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.