Tabnine Logo
CompilationUnit.setImports
Code IndexAdd Tabnine to your IDE (free)

How to use
setImports
method
in
japa.parser.ast.CompilationUnit

Best Java code snippets using japa.parser.ast.CompilationUnit.setImports (Showing top 4 results out of 315)

origin: com.google.code.javaparser/javaparser

public CompilationUnit(PackageDeclaration pakage, List<ImportDeclaration> imports, List<TypeDeclaration> types) {
  setPackage(pakage);
  setImports(imports);
  setTypes(types);
}
origin: com.google.code.javaparser/javaparser

public CompilationUnit(int beginLine, int beginColumn, int endLine, int endColumn, PackageDeclaration pakage, List<ImportDeclaration> imports, List<TypeDeclaration> types) {
  super(beginLine, beginColumn, endLine, endColumn);
  setPackage(pakage);
  setImports(imports);
  setTypes(types);
}
origin: paypal/SeLion

/**
 * This method will add methods, fields and import statement to existing java file
 * 
 * @throws IOException
 * @throws ParseException
 */
public void insertCode() throws IOException, ParseException {
  CompilationUnit cuResult = JavaParser.parse(baseFile);
  if (cuResult.getImports() != null) {
    List<ImportDeclaration> importsFromBaseFile = cuResult.getImports();
    for (ImportDeclaration eachImport : importsFromExtendedFile) {
      if (!importAlreadyPresent(importsFromBaseFile, eachImport)) {
        importsFromBaseFile.add(eachImport);
      }
    }
    cuResult.setImports(importsFromBaseFile);
  }
  String code = cuResult.toString();
  BufferedWriter b = new BufferedWriter(new FileWriter(baseFile));
  b.write(code);
  b.close();
}
origin: org.kuali.rice/rice-development-tools

unit.setImports(imports);
japa.parser.astCompilationUnitsetImports

Javadoc

Sets the list of imports of this compilation unit. The list is initially null.

Popular methods of CompilationUnit

  • getTypes
    Return the list of types declared in this compilation unit. If there is no types declared, null is r
  • getPackage
    Retrieves the package declaration of this compilation unit. If this compilation unit has no package
  • getImports
    Retrieves the list of imports declared in this compilation unit ornull if there is no import.
  • toString
  • <init>
  • accept
  • equals
  • getAllContainedComments
  • getBeginColumn
  • getBeginLine
  • getChildrenNodes
  • getComment
  • getChildrenNodes,
  • getComment,
  • getComments,
  • getEndColumn,
  • getEndLine,
  • setAsParentNodeOf,
  • setComment,
  • setPackage,
  • setTypes

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now