Package org.jboss.forge.project.facets

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveJavaSource()


         targetEntity.addImport(fieldEntity.getQualifiedName());
      }
      Refactory.createGetterAndSetter(targetEntity, field);
      updateToString(targetEntity);

      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here


         targetEntity.addImport(fieldType);
      }
      Refactory.createGetterAndSetter(targetEntity, field);

      updateToString(targetEntity);
      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here

      {
         targetEntity.addImport(fieldType);
      }
      Refactory.createGetterAndSetter(targetEntity, field);
      updateToString(targetEntity);
      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here

      {
         targetEntity.addImport(fieldType);
      }
      Refactory.createGetterAndSetter(targetEntity, field);
      updateToString(targetEntity);
      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here

         resource.setPackage(java.getBasePackage() + ".rest");

         /*
          * Save the sources
          */
         java.saveJavaSource(entity);

         if (!java.getJavaResource(resource).exists()
                  || prompt.promptBoolean("Endpoint [" + resource.getQualifiedName() + "] already, exists. Overwrite?"))
         {
            java.saveJavaSource(resource);
View Full Code Here

         java.saveJavaSource(entity);

         if (!java.getJavaResource(resource).exists()
                  || prompt.promptBoolean("Endpoint [" + resource.getQualifiedName() + "] already, exists. Overwrite?"))
         {
            java.saveJavaSource(resource);
            ShellMessages.success(out, "Generated REST endpoint for [" + entity.getQualifiedName() + "]");
         }
         else
            ShellMessages.info(out, "Aborted REST endpoint generation for [" + entity.getQualifiedName() + "]");
      }
View Full Code Here

         applicationClass.addImport("javax.ws.rs.core.Application");
         applicationClass.addImport("javax.ws.rs.ApplicationPath");

         try
         {
            javaSourceFacet.saveJavaSource(applicationClass);
         }
         catch (FileNotFoundException e)
         {
            throw new RuntimeException(e);
         }
View Full Code Here

         Field<JavaClass> localField = addFieldTo(entityClass, fieldEntityClass, fieldName, OneToOne.class);
         if ((inverseFieldName != null) && !inverseFieldName.isEmpty())
         {
            Field<JavaClass> inverseField = addFieldTo(fieldEntityClass, entityClass, inverseFieldName, OneToOne.class);
            inverseField.getAnnotation(OneToOne.class).setStringValue("mappedBy", localField.getName());
            java.saveJavaSource(fieldEntityClass);
         }
        
         if (fetchType != null)
         {
            Annotation<JavaClass> annotation = localField.getAnnotation(OneToOne.class);
View Full Code Here

        
         if (fetchType != null)
         {
            Annotation<JavaClass> annotation = localField.getAnnotation(OneToOne.class);
            annotation.setEnumValue("fetch", fetchType);
            java.saveJavaSource(entityClass);
         }
      }
      catch (FileNotFoundException e)
      {
         shell.println("Could not locate the @Entity requested. No update was made.");
View Full Code Here

                     + inverseFieldName
                     + "= new HashSet<" + entity.getName() + ">();");
            otherField.addAnnotation(ManyToMany.class);
            Refactory.createGetterAndSetter(otherEntity, otherField);

            java.saveJavaSource(otherEntity);
         }
        
         if (fetchType != null)
         {
            annotation.setEnumValue("fetch", fetchType);
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.