congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CompilationUnit.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
lombok.ast.CompilationUnit
constructor

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

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

public Node createCompilationUnit(Node packageDeclaration, List<Node> importDeclarations, List<Node> typeDeclarations) {
  CompilationUnit unit = new CompilationUnit().rawPackageDeclaration(packageDeclaration);
  if (importDeclarations != null) for (Node n : importDeclarations) if (n != null) unit.rawImportDeclarations().addToEnd(n);
  if (typeDeclarations != null) for (Node n : typeDeclarations) if (n != null) unit.rawTypeDeclarations().addToEnd(n);
  return posify(unit);
}

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

@Override public void visitCompilationUnitDeclaration(CompilationUnitDeclaration node) {
  lombok.ast.CompilationUnit unit = new lombok.ast.CompilationUnit();
  unit.rawPackageDeclaration(toTree(node.currentPackage, FlagKey.IMPORTDECLARATION_IS_PACKAGE));
  if (node.javadoc != null) {
    lombok.ast.PackageDeclaration lombokJavadoc = unit.astPackageDeclaration();
    if (lombokJavadoc != null) {
      lombokJavadoc.rawJavadoc(toTree(node.javadoc));
    }
  }
  fillList(node.imports, unit.rawImportDeclarations());
  
  TypeDeclaration[] newTypes = null;
  if (node.types != null && node.types.length > 0 && CharOperation.equals(EcjTreeBuilder.PACKAGE_INFO, node.types[0].name)) {
    newTypes = new TypeDeclaration[node.types.length - 1];
    System.arraycopy(node.types, 1, newTypes, 0, node.types.length - 1);
  } else {
    newTypes = node.types;
  }
  
  fillList(newTypes, unit.rawTypeDeclarations());
  set(node, unit);
}

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

@Override public void visitCompilationUnitDeclaration(CompilationUnitDeclaration node) {
  lombok.ast.CompilationUnit unit = new lombok.ast.CompilationUnit();
  unit.rawPackageDeclaration(toTree(node.currentPackage, FlagKey.IMPORTDECLARATION_IS_PACKAGE));
  if (node.javadoc != null) {
    lombok.ast.PackageDeclaration lombokJavadoc = unit.astPackageDeclaration();
    if (lombokJavadoc != null) {
      lombokJavadoc.rawJavadoc(toTree(node.javadoc));
    }
  }
  fillList(node.imports, unit.rawImportDeclarations());
  
  TypeDeclaration[] newTypes = null;
  if (node.types != null && node.types.length > 0 && CharOperation.equals(EcjTreeBuilder.PACKAGE_INFO, node.types[0].name)) {
    newTypes = new TypeDeclaration[node.types.length - 1];
    System.arraycopy(node.types, 1, newTypes, 0, node.types.length - 1);
  } else {
    newTypes = node.types;
  }
  
  fillList(newTypes, unit.rawTypeDeclarations());
  set(node, unit);
}

origin: org.projectlombok/lombok.ast

@Override public void visitCompilationUnitDeclaration(CompilationUnitDeclaration node) {
  lombok.ast.CompilationUnit unit = new lombok.ast.CompilationUnit();
  unit.rawPackageDeclaration(toTree(node.currentPackage, FlagKey.IMPORTDECLARATION_IS_PACKAGE));
  if (node.javadoc != null) {
    lombok.ast.PackageDeclaration lombokJavadoc = unit.astPackageDeclaration();
    if (lombokJavadoc != null) {
      lombokJavadoc.rawJavadoc(toTree(node.javadoc));
    }
  }
  fillList(node.imports, unit.rawImportDeclarations());
  
  TypeDeclaration[] newTypes = null;
  if (node.types != null && node.types.length > 0 && CharOperation.equals(EcjTreeBuilder.PACKAGE_INFO, node.types[0].name)) {
    newTypes = new TypeDeclaration[node.types.length - 1];
    System.arraycopy(node.types, 1, newTypes, 0, node.types.length - 1);
  } else {
    newTypes = node.types;
  }
  
  fillList(newTypes, unit.rawTypeDeclarations());
  set(node, unit);
}

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

public Node createCompilationUnit(Node packageDeclaration, List<Node> importDeclarations, List<Node> typeDeclarations) {
  CompilationUnit unit = new CompilationUnit().rawPackageDeclaration(packageDeclaration);
  if (importDeclarations != null) for (Node n : importDeclarations) if (n != null) unit.rawImportDeclarations().addToEnd(n);
  if (typeDeclarations != null) for (Node n : typeDeclarations) if (n != null) unit.rawTypeDeclarations().addToEnd(n);
  return posify(unit);
}

origin: org.projectlombok/lombok.ast

public Node createCompilationUnit(Node packageDeclaration, List<Node> importDeclarations, List<Node> typeDeclarations) {
  CompilationUnit unit = new CompilationUnit().rawPackageDeclaration(packageDeclaration);
  if (importDeclarations != null) for (Node n : importDeclarations) if (n != null) unit.rawImportDeclarations().addToEnd(n);
  if (typeDeclarations != null) for (Node n : typeDeclarations) if (n != null) unit.rawTypeDeclarations().addToEnd(n);
  return posify(unit);
}

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

@Override public void visitTopLevel(JCCompilationUnit node) {
  CompilationUnit unit = new CompilationUnit();
  if (node.pid != null) {
    PackageDeclaration pkg = new PackageDeclaration();
    fillWithIdentifiers(node.pid, pkg.astParts());
    unit.astPackageDeclaration(setPos(node.pid, pkg));
    fillList(node.packageAnnotations, pkg.rawAnnotations());
  }
  
  for (JCTree def : node.defs) {
    if (def instanceof JCImport) {
      unit.rawImportDeclarations().addToEnd(toTree(def));
    } else {
      unit.rawTypeDeclarations().addToEnd(toTree(def, FlagKey.SKIP_IS_DECL));
    }
  }
  
  setConversionStructureInfo(unit, "converted");
  set(node, unit);
}

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

@Override public void visitTopLevel(JCCompilationUnit node) {
  CompilationUnit unit = new CompilationUnit();
  if (node.pid != null) {
    PackageDeclaration pkg = new PackageDeclaration();
    fillWithIdentifiers(node.pid, pkg.astParts());
    unit.astPackageDeclaration(setPos(node.pid, pkg));
    fillList(node.packageAnnotations, pkg.rawAnnotations());
  }
  
  for (JCTree def : node.defs) {
    if (def instanceof JCImport) {
      unit.rawImportDeclarations().addToEnd(toTree(def));
    } else {
      unit.rawTypeDeclarations().addToEnd(toTree(def, FlagKey.SKIP_IS_DECL));
    }
  }
  
  setConversionStructureInfo(unit, "converted");
  set(node, unit);
}

origin: org.projectlombok/lombok.ast

@Override public void visitTopLevel(JCCompilationUnit node) {
  CompilationUnit unit = new CompilationUnit();
  if (node.pid != null) {
    PackageDeclaration pkg = new PackageDeclaration();
    fillWithIdentifiers(node.pid, pkg.astParts());
    unit.astPackageDeclaration(setPos(node.pid, pkg));
    fillList(node.packageAnnotations, pkg.rawAnnotations());
  }
  
  for (JCTree def : node.defs) {
    if (def instanceof JCImport) {
      unit.rawImportDeclarations().addToEnd(toTree(def));
    } else {
      unit.rawTypeDeclarations().addToEnd(toTree(def, FlagKey.SKIP_IS_DECL));
    }
  }
  
  setConversionStructureInfo(unit, "converted");
  set(node, unit);
}

lombok.astCompilationUnit<init>

Popular methods of CompilationUnit

  • astPackageDeclaration
  • astImportDeclarations
  • astTypeDeclarations
  • getPosition
  • rawImportDeclarations
  • rawPackageDeclaration
  • rawTypeDeclarations

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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