本文整理汇总了Java中com.github.javaparser.ast.ImportDeclaration.accept方法的典型用法代码示例。如果您正苦于以下问题:Java ImportDeclaration.accept方法的具体用法?Java ImportDeclaration.accept怎么用?Java ImportDeclaration.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.javaparser.ast.ImportDeclaration
的用法示例。
在下文中一共展示了ImportDeclaration.accept方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.github.javaparser.ast.ImportDeclaration; //导入方法依赖的package包/类
@Override public void visit(final CompilationUnit n, final Object arg) {
printJavaComment(n.getComment(), arg);
if (n.getPackage() != null) {
n.getPackage().accept(this, arg);
}
if (!isNullOrEmpty(n.getImports())) {
for (final ImportDeclaration i : n.getImports()) {
i.accept(this, arg);
}
printer.printLn();
}
if (!isNullOrEmpty(n.getTypes())) {
for (final Iterator<TypeDeclaration> i = n.getTypes().iterator(); i.hasNext();) {
i.next().accept(this, arg);
printer.printLn();
if (i.hasNext()) {
printer.printLn();
}
}
}
printOrphanCommentsEnding(n);
}
示例2: visit
import com.github.javaparser.ast.ImportDeclaration; //导入方法依赖的package包/类
@Override public void visit(final CompilationUnit n, final A arg) {
visitComment(n.getComment(), arg);
if (n.getPackage() != null) {
n.getPackage().accept(this, arg);
}
if (n.getImports() != null) {
for (final ImportDeclaration i : n.getImports()) {
i.accept(this, arg);
}
}
if (n.getTypes() != null) {
for (final TypeDeclaration typeDeclaration : n.getTypes()) {
typeDeclaration.accept(this, arg);
}
}
}
示例3: visit
import com.github.javaparser.ast.ImportDeclaration; //导入方法依赖的package包/类
@Override public void visit(final CompilationUnit n, final A arg) {
visitComment(n.getComment(), arg);
if (n.getPackage() != null) {
n.getPackage().accept(this, arg);
}
if (n.getImports() != null) {
for (final ImportDeclaration i : n.getImports()) {
i.accept(this, arg);
}
}
if (n.getTypes() != null) {
for (final TypeDeclaration typeDeclaration : n.getTypes()) {
typeDeclaration.accept(this, arg);
}
}
}
示例4: visit
import com.github.javaparser.ast.ImportDeclaration; //导入方法依赖的package包/类
@Override public void visit(final CompilationUnit n, final Object arg) {
printJavaComment(n.getComment(), arg);
if (n.getPackage() != null) {
n.getPackage().accept(this, arg);
}
if (n.getImports() != null) {
for (final ImportDeclaration i : n.getImports()) {
i.accept(this, arg);
}
printer.printLn();
}
if (n.getTypes() != null) {
for (final Iterator<TypeDeclaration> i = n.getTypes().iterator(); i.hasNext();) {
i.next().accept(this, arg);
printer.printLn();
if (i.hasNext()) {
printer.printLn();
}
}
}
printOrphanCommentsEnding(n);
}
示例5: visit
import com.github.javaparser.ast.ImportDeclaration; //导入方法依赖的package包/类
@Override
public void visit(final CompilationUnit n, final Object arg) {
printer.printLn("CompilationUnit");
printJavaComment(n.getComment(), arg);
if (n.getPackage() != null) {
n.getPackage().accept(this, arg);
}
if (n.getImports() != null) {
for (final ImportDeclaration i : n.getImports()) {
i.accept(this, arg);
}
printer.printLn();
}
if (n.getTypes() != null) {
for (final Iterator<TypeDeclaration> i = n.getTypes().iterator(); i.hasNext(); ) {
i.next().accept(this, arg);
printer.printLn();
if (i.hasNext()) {
printer.printLn();
}
}
}
printOrphanCommentsEnding(n);
}
示例6: visit
import com.github.javaparser.ast.ImportDeclaration; //导入方法依赖的package包/类
@Override
public void visit(final CompilationUnit n, final Object arg) {
printJavaComment(n.getComment(), arg);
if (n.getPackage() != null) {
n.getPackage().accept(this, arg);
}
if (!isNullOrEmpty(n.getImports())) {
for (final ImportDeclaration i : n.getImports()) {
i.accept(this, arg);
}
printer.println();
}
if (!isNullOrEmpty(n.getTypes())) {
for (final Iterator<TypeDeclaration> i = n.getTypes().iterator(); i.hasNext(); ) {
i.next().accept(this, arg);
printer.println();
if (i.hasNext()) {
printer.println();
}
}
}
printOrphanCommentsEnding(n);
}