Examples of addImport()


Examples of org.drools.workbench.models.commons.shared.imports.Imports.addImport()

                    if ( line.startsWith( KEYWORD ) ) {
                        line = line.substring( KEYWORD.length() ).trim();
                        if ( line.endsWith( ";" ) ) {
                            line = line.substring( 0, line.length() - 1 );
                        }
                        imports.addImport( new Import( line ) );
                    }
                }
            }

            return imports;
View Full Code Here

Examples of org.drools.workbench.models.datamodel.imports.Imports.addImport()

                    if ( line.startsWith( KEYWORD ) ) {
                        line = line.substring( KEYWORD.length() ).trim();
                        if ( line.endsWith( ";" ) ) {
                            line = line.substring( 0, line.length() - 1 );
                        }
                        imports.addImport( new Import( line ) );
                    }
                }
            }

            return imports;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ImportRewrite.addImport()

        // add import
        try
        {
            ImportRewrite rewrite = CodeStyleConfiguration.createImportRewrite(
                fCompilationUnit, true);
            rewrite.addImport(result.getClassName());
            JavaModelUtil.applyEdit(fCompilationUnit, rewrite.rewriteImports(null),
                false, null);
        }
        catch (CoreException e)
        {
View Full Code Here

Examples of org.eclipse.jdt.internal.core.dom.rewrite.ImportRewriteAnalyzer.addImport()

      computer.setFilterImplicitImports(this.filterImplicitImports);

      if (this.addedImports != null) {
        for (int i= 0; i < this.addedImports.size(); i++) {
          String curr= (String) this.addedImports.get(i);
          computer.addImport(curr.substring(1), STATIC_PREFIX == curr.charAt(0));
        }
      }

      if (this.removedImports != null) {
        for (int i= 0; i < this.removedImports.size(); i++) {
View Full Code Here

Examples of org.jboss.forge.parser.java.JavaAnnotation.addImport()

      String simpleName = Types.toSimpleName(typeName);

      JavaAnnotation origin = getOrigin();
      if (!Strings.areEqual(typeName, simpleName) && origin.requiresImport(typeName))
      {
         origin.addImport(typeName);
      }

      Code primitive = PrimitiveType.toCode(typeName);

      org.eclipse.jdt.core.dom.Type type = null;
View Full Code Here

Examples of org.jboss.forge.parser.java.JavaClass.addImport()

         map.put("setIdStatement", idSetterName);
         map.put("contentType", contentType);
         map.put("entityTable", getEntityTable(entity));

         JavaClass endpoint = JavaParser.parse(JavaClass.class, template.render(map));
         endpoint.addImport(entity.getQualifiedName());
         endpoint.setPackage(java.getBasePackage() + ".rest");
         endpoint.getAnnotation(Path.class).setStringValue("/" + getEntityTable(entity).toLowerCase());

         /*
         * Save the sources
View Full Code Here

Examples of org.jboss.forge.parser.java.JavaInterface.addImport()

   @Test
   public void testImportImport() throws Exception
   {
      JavaInterface foo = JavaParser.parse(JavaInterface.class, "public interface Foo{}");
      Import i = foo.addImport(getClass());

      foo.removeImport(getClass());
      Import i2 = foo.addImport(i);
      assertNotSame(i, i2);
      assertEquals(i.getQualifiedName(), i2.getQualifiedName());
View Full Code Here

Examples of org.jboss.forge.parser.java.source.JavaAnnotationSource.addImport()

      String simpleName = Types.toSimpleName(typeName);

      JavaAnnotationSource origin = getOrigin();
      if (!Strings.areEqual(typeName, simpleName) && origin.requiresImport(typeName))
      {
         origin.addImport(typeName);
      }

      Code primitive = PrimitiveType.toCode(typeName);

      org.eclipse.jdt.core.dom.Type type = null;
View Full Code Here

Examples of org.jboss.forge.roaster.model.source.JavaAnnotationSource.addImport()

      String simpleName = Types.toSimpleName(typeName);

      JavaAnnotationSource origin = getOrigin();
      if (!Strings.areEqual(typeName, simpleName) && origin.requiresImport(typeName))
      {
         origin.addImport(typeName);
      }

      Code primitive = PrimitiveType.toCode(typeName);

      org.eclipse.jdt.core.dom.Type type = null;
View Full Code Here

Examples of org.jboss.forge.roaster.model.source.JavaClassSource.addImport()

      Resource<URL> templateResource = resourceFactory.create(getClass().getResource("Dao.jv"));
      Template processor = templateFactory.create(templateResource, FreemarkerTemplate.class);
      String output = processor.process(map);
      JavaClassSource resource = Roaster.parse(JavaClassSource.class, output);
      resource.addImport(entity.getQualifiedName());
      resource.setPackage(context.getTargetPackageName());
      return Arrays.asList(resource);
   }

   @Override
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.