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

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


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

         java.saveJavaSource(otherEntity);
      }

      if (fetchType != null && fetchType != FetchType.LAZY)
      {
         annotation.setEnumValue("fetch", fetchType);
View Full Code Here


      if (fetchType != null && fetchType != FetchType.LAZY)
      {
         annotation.setEnumValue("fetch", fetchType);
      }
      addCascade(cascadeTypes, annotation);
      java.saveJavaSource(entity);
   }

   private void updateToString(final JavaClass targetEntity)
   {
      if (targetEntity.hasMethodSignature("toString"))
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);
         return Results.success("Field " + named.getValue() + " created");
      }
      else
View Full Code Here

            throws FileNotFoundException
   {
      final Annotation<JavaClass> constraint = addConstraintOnProperty(property, onAccessor, Valid.class, null);

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      javaSourceFacet.saveJavaSource(constraint.getOrigin());
      return outputConstraintAdded(property, Valid.class);
   }

   public Result addNullConstraint(Project project, Property property, boolean onAccessor, String message)
            throws FileNotFoundException
View Full Code Here

            throws FileNotFoundException
   {
      final Annotation<JavaClass> constraint = addConstraintOnProperty(property, onAccessor, Null.class, message);

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      javaSourceFacet.saveJavaSource(constraint.getOrigin());
      return outputConstraintAdded(property, Null.class);
   }

   public Result addNotNullConstraint(Project project, Property property, boolean onAccessor, String message)
            throws FileNotFoundException
View Full Code Here

   {
      final Annotation<JavaClass> constraintAnnotation = addConstraintOnProperty(property, onAccessor, NotNull.class,
               message);

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      javaSourceFacet.saveJavaSource(constraintAnnotation.getOrigin());
      return outputConstraintAdded(property, NotNull.class);
   }

   public Result addAssertTrueConstraint(Project project, Property property, boolean onAccessor, String message)
            throws FileNotFoundException
View Full Code Here

   {
      final Annotation<JavaClass> constraintAnnotation = addConstraintOnProperty(property, onAccessor,
               AssertTrue.class, message);

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      javaSourceFacet.saveJavaSource(constraintAnnotation.getOrigin());
      return outputConstraintAdded(property, AssertTrue.class);
   }

   public Result addAssertFalseConstraint(Project project, Property property, boolean onAccessor, String message)
            throws FileNotFoundException
View Full Code Here

   {
      final Annotation<JavaClass> constraintAnnotation = addConstraintOnProperty(property, onAccessor,
               AssertFalse.class, message);

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      javaSourceFacet.saveJavaSource(constraintAnnotation.getOrigin());
      return outputConstraintAdded(property, AssertFalse.class);
   }

   public Result addMinConstraint(Project project, Property property, boolean onAccessor, String message, long min)
            throws FileNotFoundException
View Full Code Here

      final Annotation<JavaClass> constraintAnnotation = addConstraintOnProperty(property, onAccessor, Min.class,
               message);
      constraintAnnotation.setLiteralValue(String.valueOf(min));

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      javaSourceFacet.saveJavaSource(constraintAnnotation.getOrigin());
      return outputConstraintAdded(property, Min.class);
   }

   public Result addMaxConstraint(Project project, Property property, boolean onAccessor, String message, long max)
            throws FileNotFoundException
View Full Code Here

      final Annotation<JavaClass> constraintAnnotation = addConstraintOnProperty(property, onAccessor, Max.class,
               message);
      constraintAnnotation.setLiteralValue(String.valueOf(max));

      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      javaSourceFacet.saveJavaSource(constraintAnnotation.getOrigin());
      return outputConstraintAdded(property, Max.class);
   }

   public Result addDecimalMinConstraint(Project project, Property property, boolean onAccessor, String message,
            String min) throws FileNotFoundException
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.