Package org.jboss.forge.resources.java

Examples of org.jboss.forge.resources.java.JavaResource


      JavaClass javaClass = JavaParser.create(JavaClass.class).setName(name).setPackage(ejbPackage);
      if (serializable)
      {
         javaClass.addInterface(Serializable.class);
      }
      JavaResource resource = javaSourceFacet.getJavaResource(javaClass);
      if (!resource.exists())
      {
         resource.createNewFile();
         ejb = javaClass;
      }
      else
      {
         if (shell.promptBoolean("The EJB class already exists, do you want to overwrite it?"))
         {
            ejb = getJavaClassFrom(resource);
         }
         else
         {
            throw new RuntimeException("The EJB class already exists ["
                     + resource.getFullyQualifiedName()
                     + "] ");
         }

      }
      if (type == null)
View Full Code Here


   {
      String path = relativePath.trim().endsWith(".java")
               ? relativePath.substring(0, relativePath.lastIndexOf(".java")) : relativePath;

      path = Packages.toFileSyntax(path) + ".java";
      JavaResource target = sourceDir.getChildOfType(JavaResource.class, path);
      return target;
   }
View Full Code Here

   {
      String path = relativePath.trim().endsWith(".java")
               ? relativePath.substring(0, relativePath.lastIndexOf(".java")) : relativePath;

      path = Packages.toFileSyntax(path) + ".java";
      JavaResource target = sourceDir.getChildOfType(JavaResource.class, path);
      return target;
   }
View Full Code Here

               if (getCurrentProject().hasFacet(JavaSourceFacet.class))
               {
                  JavaSourceFacet java = getCurrentProject().getFacet(JavaSourceFacet.class);
                  try
                  {
                     JavaResource resource = java.getJavaResource(obj.toString());
                     return resource;
                  }
                  catch (FileNotFoundException e)
                  {
                     throw new RuntimeException(e);
View Full Code Here

TOP

Related Classes of org.jboss.forge.resources.java.JavaResource

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.