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

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


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

   public void newManyToManyRelationship(
            final Project project,
            final JavaResource resource,
View Full Code Here


    if (!(result instanceof Failed))
    {
      JavaSourceFacet javaSourceFacet = getSelectedProject(context).getFacet(JavaSourceFacet.class);
      JavaResource javaResource = context.getUIContext().getSelection();
      JavaSource<?> javaSource = javaResource.getJavaSource();
      javaSourceFacet.saveJavaSource(javaSource);
    }
    return result;
  }

  @Override
View Full Code Here

                  + 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

         // Constraint annotation body
         constraint.addAnnotationElement("String message() default \"Invalid value\"");
         constraint.addAnnotationElement("Class<?>[] groups() default { }");
         constraint.addAnnotationElement("Class<? extends Payload>[] payload() default { }");

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

   @Override
View Full Code Here

      else
      {
         SOURCETYPE decorated = decorateSource(context, project, source);
         if (decorated != null)
            source = decorated;
         javaResource = javaSourceFacet.saveJavaSource(source);
      }

      uiContext.setSelection(javaResource);
      return Results.success(getType() + " " + source.getQualifiedName() + " was created");
   }
View Full Code Here

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

   @Override
View Full Code Here

         }
         Project selectedProject = getSelectedProject(context);
         if (selectedProject != null)
         {
            JavaSourceFacet facet = selectedProject.getFacet(JavaSourceFacet.class);
            facet.saveJavaSource(field.getOrigin());
         }
         context.setSelection(javaResource);
         return Results.success("Field " + fieldName.getValue() + " created");
      }
      else
View Full Code Here

      }
      else
      {
         applicationClass.addAnnotation(ApplicationPath.class).setStringValue(path);
      }
      facet.saveJavaSource(applicationClass);
   }

   @Override
   public void uninstall(Project project)
   {
View Full Code Here

      else
      {
         SOURCETYPE decorated = decorateSource(context, project, source);
         if (decorated != null)
            source = decorated;
         javaResource = javaSourceFacet.saveJavaSource(source);
      }

      uiContext.setSelection(javaResource);
      return Results.success(getType() + " " + source.getQualifiedName() + " was created");
   }
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.