Package org.jboss.forge.addon.javaee.rest

Examples of org.jboss.forge.addon.javaee.rest.RestFacet


    *
    * @return The root path of the REST resources generated by the Forge REST plugin.
    */
   private String getRootResourcePath(Project project)
   {
      RestFacet rest = project.getFacet(RestFacet.class);
      String resourceRootPath = trimSlashes(rest.getApplicationPath());
      return resourceRootPath;
   }
View Full Code Here


   }

   @Override
   public Result execute(final UIExecutionContext context) throws Exception
   {
      RestFacet facet = jaxrsVersion.getValue();
      if (facetFactory.install(getSelectedProject(context), facet))
      {
         String path = applicationPath.getValue();
         final RestConfigurationStrategy strategy;
         if (config.getValue() == RestActivatorType.WEB_XML)
         {
            strategy = RestConfigurationStrategyFactory.createUsingWebXml(path);
         }
         else
         {
            JavaClass javaClass = JavaParser.create(JavaClass.class).setPackage(targetPackage.getValue())
                     .setName(className.getValue());
            strategy = RestConfigurationStrategyFactory.createUsingJavaClass(path, javaClass);
         }
         facet.setConfigurationStrategy(strategy);
         return Results.success("JAX-RS has been installed.");
      }
      return Results.fail("Could not install JAX-RS.");
   }
View Full Code Here

   }

   @Override
   public Result execute(final UIExecutionContext context) throws Exception
   {
      RestFacet facet = jaxrsVersion.getValue();
      if (facetFactory.install(getSelectedProject(context), facet))
      {
         String path = applicationPath.getValue();
         final RestConfigurationStrategy strategy;
         if (config.getValue() == RestActivatorType.WEB_XML)
         {
            strategy = RestConfigurationStrategyFactory.createUsingWebXml(path);
         }
         else
         {
            JavaClass javaClass = JavaParser.create(JavaClass.class).setPackage(packageName.getValue())
                     .setName(className.getValue());
            strategy = RestConfigurationStrategyFactory.createUsingJavaClass(path, javaClass);
         }
         facet.setConfigurationStrategy(strategy);
         return Results.success("JAX-RS has been installed.");
      }
      return Results.fail("Could not install JAX-RS.");
   }
View Full Code Here

   }

   @Override
   public Result execute(final UIContext context) throws Exception
   {
      RestFacet facet = jaxrsVersion.getValue();
      if (facetFactory.install(getSelectedProject(context), facet))
      {
         String path = applicationPath.getValue();
         final RestConfigurationStrategy strategy;
         if (config.getValue() == RestActivatorType.WEB_XML)
         {
            strategy = RestConfigurationStrategyFactory.createUsingWebXml(path);
         }
         else
         {
            JavaClass javaClass = JavaParser.create(JavaClass.class).setPackage(packageName.getValue())
                     .setName(className.getValue());
            strategy = RestConfigurationStrategyFactory.createUsingJavaClass(path, javaClass);
         }
         facet.setConfigurationStrategy(strategy);
         return Results.success("JAX-RS has been installed.");
      }
      return Results.fail("Could not install JAX-RS.");
   }
View Full Code Here

   }

   @Override
   public Result execute(final UIExecutionContext context) throws Exception
   {
      RestFacet facet = jaxrsVersion.getValue();
      if (facetFactory.install(getSelectedProject(context), facet))
      {
         String path = applicationPath.getValue();
         final RestConfigurationStrategy strategy;
         if (config.getValue() == RestActivatorType.WEB_XML)
         {
            strategy = RestConfigurationStrategyFactory.createUsingWebXml(path);
         }
         else
         {
            JavaClassSource javaClass = Roaster.create(JavaClassSource.class).setPackage(targetPackage.getValue())
                     .setName(className.getValue());
            strategy = RestConfigurationStrategyFactory.createUsingJavaClass(path, javaClass);
         }
         facet.setConfigurationStrategy(strategy);
         return Results.success("JAX-RS has been installed.");
      }
      return Results.fail("Could not install JAX-RS.");
   }
View Full Code Here

    *
    * @return The root path of the REST resources generated by the Forge REST plugin.
    */
   private String getRootResourcePath(Project project)
   {
      RestFacet rest = project.getFacet(RestFacet.class);
      String resourceRootPath = trimSlashes(rest.getApplicationPath());
      return resourceRootPath;
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.javaee.rest.RestFacet

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.