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

How to use
astImportDeclarations
method
in
lombok.ast.CompilationUnit

Best Java code snippets using lombok.ast.CompilationUnit.astImportDeclarations (Showing top 9 results out of 315)

origin: me.tatarka.retrolambda.projectlombok/lombok.ast

private ImportList getImportList(Node n) {
  ImportList il = new ImportList();
  
  while (n != null) {
    if (n instanceof CompilationUnit) {
      CompilationUnit cu = (CompilationUnit) n;
      PackageDeclaration pkg = cu.astPackageDeclaration();
      if (pkg != null) il.stars.add(pkg.getPackageName());
      for (ImportDeclaration imp : cu.astImportDeclarations()) {
        if (imp.astStaticImport()) continue;
        if (imp.astStarImport()) {
          String i = imp.asFullyQualifiedName();
          i = i.substring(0, i.length() - 2);
          il.stars.add(i);
        } else {
          il.explicits.add(imp.asFullyQualifiedName());
        }
      }
    }
    
    n = n.getParent();
  }
  
  return il;
}

origin: com.android.tools.external.lombok/lombok-ast

private ImportList getImportList(Node n) {
  ImportList il = new ImportList();
  
  while (n != null) {
    if (n instanceof CompilationUnit) {
      CompilationUnit cu = (CompilationUnit) n;
      PackageDeclaration pkg = cu.astPackageDeclaration();
      if (pkg != null) il.stars.add(pkg.getPackageName());
      for (ImportDeclaration imp : cu.astImportDeclarations()) {
        if (imp.astStaticImport()) continue;
        if (imp.astStarImport()) {
          String i = imp.asFullyQualifiedName();
          i = i.substring(0, i.length() - 2);
          il.stars.add(i);
        } else {
          il.explicits.add(imp.asFullyQualifiedName());
        }
      }
    }
    
    n = n.getParent();
  }
  
  return il;
}

origin: org.projectlombok/lombok.ast

private ImportList getImportList(Node n) {
  ImportList il = new ImportList();
  
  while (n != null) {
    if (n instanceof CompilationUnit) {
      CompilationUnit cu = (CompilationUnit) n;
      PackageDeclaration pkg = cu.astPackageDeclaration();
      if (pkg != null) il.stars.add(pkg.getPackageName());
      for (ImportDeclaration imp : cu.astImportDeclarations()) {
        if (imp.astStaticImport()) continue;
        if (imp.astStarImport()) {
          String i = imp.asFullyQualifiedName();
          i = i.substring(0, i.length() - 2);
          il.stars.add(i);
        } else {
          il.explicits.add(imp.asFullyQualifiedName());
        }
      }
    }
    
    n = n.getParent();
  }
  
  return il;
}

origin: me.tatarka.retrolambda.projectlombok/lombok.ast

cud.imports = toArray(ImportReference.class, node.astImportDeclarations());
cud.types = toArray(TypeDeclaration.class, node.astTypeDeclarations());
origin: org.projectlombok/lombok.ast

cud.imports = toArray(ImportReference.class, node.astImportDeclarations());
cud.types = toArray(TypeDeclaration.class, node.astTypeDeclarations());
origin: com.android.tools.external.lombok/lombok-ast

cud.imports = toArray(ImportReference.class, node.astImportDeclarations());
cud.types = toArray(TypeDeclaration.class, node.astTypeDeclarations());
origin: com.android.tools.external.lombok/lombok-ast

@Override
public boolean visitCompilationUnit(CompilationUnit node) {
  List<JCTree> preamble = toList(JCTree.class, node.astPackageDeclaration());
  List<JCTree> imports = toList(JCTree.class, node.astImportDeclarations());
  List<JCTree> types = toList(JCTree.class, node.astTypeDeclarations());
  int end = node.getPosition().getEnd();
  if (node.astPackageDeclaration() != null) start = Math.min(start, node.astPackageDeclaration().getPosition().getStart());
  if (!node.astImportDeclarations().isEmpty()) start = Math.min(start, node.rawImportDeclarations().first().getPosition().getStart());
  if (!node.astTypeDeclarations().isEmpty()) start = Math.min(start, node.rawTypeDeclarations().first().getPosition().getStart());
  if (start == Integer.MAX_VALUE) start = node.getPosition().getStart();
origin: org.projectlombok/lombok.ast

@Override
public boolean visitCompilationUnit(CompilationUnit node) {
  List<JCTree> preamble = toList(JCTree.class, node.astPackageDeclaration());
  List<JCTree> imports = toList(JCTree.class, node.astImportDeclarations());
  List<JCTree> types = toList(JCTree.class, node.astTypeDeclarations());
  int end = node.getPosition().getEnd();
  if (node.astPackageDeclaration() != null) start = Math.min(start, node.astPackageDeclaration().getPosition().getStart());
  if (!node.astImportDeclarations().isEmpty()) start = Math.min(start, node.rawImportDeclarations().first().getPosition().getStart());
  if (!node.astTypeDeclarations().isEmpty()) start = Math.min(start, node.rawTypeDeclarations().first().getPosition().getStart());
  if (start == Integer.MAX_VALUE) start = node.getPosition().getStart();
origin: me.tatarka.retrolambda.projectlombok/lombok.ast

@Override
public boolean visitCompilationUnit(CompilationUnit node) {
  List<JCTree> preamble = toList(JCTree.class, node.astPackageDeclaration());
  List<JCTree> imports = toList(JCTree.class, node.astImportDeclarations());
  List<JCTree> types = toList(JCTree.class, node.astTypeDeclarations());
  int end = node.getPosition().getEnd();
  if (node.astPackageDeclaration() != null) start = Math.min(start, node.astPackageDeclaration().getPosition().getStart());
  if (!node.astImportDeclarations().isEmpty()) start = Math.min(start, node.rawImportDeclarations().first().getPosition().getStart());
  if (!node.astTypeDeclarations().isEmpty()) start = Math.min(start, node.rawTypeDeclarations().first().getPosition().getStart());
  if (start == Integer.MAX_VALUE) start = node.getPosition().getStart();
lombok.astCompilationUnitastImportDeclarations

Popular methods of CompilationUnit

  • astPackageDeclaration
  • <init>
  • astTypeDeclarations
  • getPosition
  • rawImportDeclarations
  • rawPackageDeclaration
  • rawTypeDeclarations

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Join (org.hibernate.mapping)
  • Top 12 Jupyter Notebook extensions
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