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

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


   {
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      JavaSource<?> source = JavaParser.create(getSourceType()).setName(named.getValue());
      JavaResource javaResource;
      if (targetPackage.hasValue() || targetPackage.hasDefaultValue())
      {
         source.setPackage(targetPackage.getValue());
      }
      else
View Full Code Here


   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Project project = getSelectedProject(context);
      JavaResource javaResource = targetEntity.getValue();
      String fieldNameStr = named.getValue();
      JavaClassSource targetEntity = javaResource.getJavaType();
      FieldSource<JavaClassSource> field = targetEntity.getField(fieldNameStr);
      String action = (field == null) ? "created" : "updated";
      if (field != null)
      {
         UIPrompt prompt = context.getPrompt();
View Full Code Here

   public void validate(UIValidationContext validator)
   {
      super.validate(validator);
      try
      {
         JavaResource javaResource = targetEntity.getValue();
         if (javaResource != null)
         {
            JavaClassSource javaClass = javaResource.getJavaType();
            if (javaClass.hasField(named.getValue()))
            {
               validator.addValidationWarning(targetEntity, "Field '" + named.getValue() + "' already exists");
            }
         }
View Full Code Here

         return false;
      }
      boolean classAlreadyExists;
      try
      {
         JavaResource parsedJavaResource = javaSourceFacet.getJavaResource(source);
         classAlreadyExists = parsedJavaResource.exists();
      }
      catch (FileNotFoundException | ResourceException ex)
      {
         classAlreadyExists = false;
      }
View Full Code Here

   {
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JavaSourceFacet javaSourceFacet = project.getFacet(JavaSourceFacet.class);
      SOURCETYPE source = buildJavaSource(javaSourceFacet);
      JavaResource javaResource;
      if (source.hasSyntaxErrors())
      {
         UIOutput output = uiContext.getProvider().getOutput();
         PrintStream err = output.err();
         err.println("Syntax Errors:");
View Full Code Here

      for (Object resource : resources)
      {
         JavaSource<?> javaSource = null;
         if (resource instanceof JavaResource)
         {
            JavaResource javaResource = (JavaResource) resource;
            try
            {
               javaSource = javaResource.getJavaType();
            }
            catch (FileNotFoundException fileEx)
            {
               throw new IllegalStateException(fileEx);
            }
View Full Code Here

               ResourceCollection.class);

      targets = new ArrayList<>();
      for (Resource<?> resource : resourceCollection.getResources())
      {
         JavaResource javaResource = (JavaResource) resource;
         JavaClassSource javaClass = javaResource.getJavaType();
         targets.add(javaClass);
      }

      RestGenerationContext generationContext = createContextFor(uiContext);
      Set<JavaClassSource> endpoints = generateEndpoints(generationContext);
View Full Code Here

   private JavaClassSource getJavaClass(String qualifiedType)
   {
      JavaSourceFacet java = this.project.getFacet(JavaSourceFacet.class);
      try
      {
         JavaResource resource = java.getJavaResource(qualifiedType);
         JavaClassSource javaClass = resource.getJavaType();
         return javaClass;
      }
      catch (FileNotFoundException fileEx)
      {
         throw new RuntimeException(fileEx);
View Full Code Here

      for (Resource<?> resource : resources)
      {
         JavaSource<?> javaSource = null;
         if (resource instanceof JavaResource)
         {
            JavaResource javaResource = (JavaResource) resource;
            try
            {
               javaSource = javaResource.getJavaType();
            }
            catch (FileNotFoundException fileEx)
            {
               throw new IllegalStateException(fileEx);
            }
View Full Code Here

      {
         idStrategyChosen = GenerationType.AUTO;
      }
      DirectoryResource targetDir = targetLocation.getValue();
      Project project = getSelectedProject(context);
      JavaResource javaResource;
      if (project == null)
      {
         javaResource = persistenceOperations.newEntity(targetDir, entityName, entityPackage, idStrategyChosen,
                  tableName.getValue());
      }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.parser.java.resources.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.