本文整理汇总了Java中com.github.javaparser.ast.body.EnumConstantDeclaration.accept方法的典型用法代码示例。如果您正苦于以下问题:Java EnumConstantDeclaration.accept方法的具体用法?Java EnumConstantDeclaration.accept怎么用?Java EnumConstantDeclaration.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.javaparser.ast.body.EnumConstantDeclaration
的用法示例。
在下文中一共展示了EnumConstantDeclaration.accept方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.github.javaparser.ast.body.EnumConstantDeclaration; //导入方法依赖的package包/类
@Override public void visit(final EnumDeclaration n, final A arg) {
visitComment(n.getComment(), arg);
if (n.getJavaDoc() != null) {
n.getJavaDoc().accept(this, arg);
}
if (n.getAnnotations() != null) {
for (final AnnotationExpr a : n.getAnnotations()) {
a.accept(this, arg);
}
}
if (n.getImplements() != null) {
for (final ClassOrInterfaceType c : n.getImplements()) {
c.accept(this, arg);
}
}
if (n.getEntries() != null) {
for (final EnumConstantDeclaration e : n.getEntries()) {
e.accept(this, arg);
}
}
if (n.getMembers() != null) {
for (final BodyDeclaration member : n.getMembers()) {
member.accept(this, arg);
}
}
}
示例2: visit
import com.github.javaparser.ast.body.EnumConstantDeclaration; //导入方法依赖的package包/类
@Override public void visit(final EnumDeclaration n, final A arg) {
visitComment(n.getComment(), arg);
visitAnnotations(n, arg);
n.getNameExpr().accept(this, arg);
if (n.getImplements() != null) {
for (final ClassOrInterfaceType c : n.getImplements()) {
c.accept(this, arg);
}
}
if (n.getEntries() != null) {
for (final EnumConstantDeclaration e : n.getEntries()) {
e.accept(this, arg);
}
}
if (n.getMembers() != null) {
for (final BodyDeclaration<?> member : n.getMembers()) {
member.accept(this, arg);
}
}
}
示例3: visit
import com.github.javaparser.ast.body.EnumConstantDeclaration; //导入方法依赖的package包/类
@Override public void visit(final EnumDeclaration n, final A arg) {
jw.write(n);
visitComment(n.getComment(), arg);
if (n.getJavaDoc() != null) {
n.getJavaDoc().accept(this, arg);
}
if (n.getAnnotations() != null) {
for (final AnnotationExpr a : n.getAnnotations()) {
a.accept(this, arg);
}
}
if (n.getImplements() != null) {
for (final ClassOrInterfaceType c : n.getImplements()) {
c.accept(this, arg);
}
}
if (n.getEntries() != null) {
for (final EnumConstantDeclaration e : n.getEntries()) {
e.accept(this, arg);
}
}
if (n.getMembers() != null) {
for (final BodyDeclaration member : n.getMembers()) {
member.accept(this, arg);
}
}
}
示例4: visit
import com.github.javaparser.ast.body.EnumConstantDeclaration; //导入方法依赖的package包/类
@Override
public void visit(final EnumDeclaration n, final Void arg) {
printJavaComment(n.getComment(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
printer.print("enum ");
n.getName().accept(this, arg);
if (!n.getImplementedTypes().isEmpty()) {
printer.print(" implements ");
for (final Iterator<ClassOrInterfaceType> i = n.getImplementedTypes().iterator(); i.hasNext(); ) {
final ClassOrInterfaceType c = i.next();
c.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.println(" {");
printer.indent();
if (n.getEntries() != null) {
for (final Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext(); ) {
final EnumConstantDeclaration e = i.next();
e.accept(this, arg);
if (i.hasNext()) {
printer.println(",");
}
}
}
if (!n.getMembers().isEmpty()) {
printer.println(";");
printer.println();
printMembers(n.getMembers(), arg);
} else {
if (!n.getEntries().isEmpty()) {
printer.println();
}
}
printer.unindent();
printer.print("}");
}
示例5: visit
import com.github.javaparser.ast.body.EnumConstantDeclaration; //导入方法依赖的package包/类
@Override
public void visit(final EnumDeclaration n, final Object arg) {
printer.printLn("EnumDeclaration");
printJavaComment(n.getComment(), arg);
printJavadoc(n.getJavaDoc(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
printer.print("enum ");
printer.print(n.getName());
if (n.getImplements() != null) {
printer.print(" implements ");
for (final Iterator<ClassOrInterfaceType> i = n.getImplements().iterator(); i.hasNext(); ) {
final ClassOrInterfaceType c = i.next();
c.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.printLn(" {");
printer.indent();
if (n.getEntries() != null) {
printer.printLn();
for (final Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext(); ) {
final EnumConstantDeclaration e = i.next();
e.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
if (n.getMembers() != null) {
printer.printLn(";");
printMembers(n.getMembers(), arg);
} else {
if (n.getEntries() != null) {
printer.printLn();
}
}
printer.unindent();
printer.print("}");
}
示例6: visit
import com.github.javaparser.ast.body.EnumConstantDeclaration; //导入方法依赖的package包/类
@Override public void visit(final EnumDeclaration n, final Object arg) {
printJavaComment(n.getComment(), arg);
printJavadoc(n.getJavaDoc(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
printer.print("enum ");
printer.print(n.getName());
if (!n.getImplements().isEmpty()) {
printer.print(" implements ");
for (final Iterator<ClassOrInterfaceType> i = n.getImplements().iterator(); i.hasNext();) {
final ClassOrInterfaceType c = i.next();
c.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.printLn(" {");
printer.indent();
if (n.getEntries() != null) {
printer.printLn();
for (final Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
final EnumConstantDeclaration e = i.next();
e.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
if (!n.getMembers().isEmpty()) {
printer.printLn(";");
printMembers(n.getMembers(), arg);
} else {
if (!n.getEntries().isEmpty()) {
printer.printLn();
}
}
printer.unindent();
printer.print("}");
}
示例7: visit
import com.github.javaparser.ast.body.EnumConstantDeclaration; //导入方法依赖的package包/类
@Override public void visit(final EnumDeclaration n, final Object arg) {
printJavaComment(n.getComment(), arg);
printJavadoc(n.getJavaDoc(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
printer.print("enum ");
printer.print(n.getName());
if (n.getImplements() != null) {
printer.print(" implements ");
for (final Iterator<ClassOrInterfaceType> i = n.getImplements().iterator(); i.hasNext();) {
final ClassOrInterfaceType c = i.next();
c.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.printLn(" {");
printer.indent();
if (n.getEntries() != null) {
printer.printLn();
for (final Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
final EnumConstantDeclaration e = i.next();
e.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
if (n.getMembers() != null) {
printer.printLn(";");
printMembers(n.getMembers(), arg);
} else {
if (n.getEntries() != null) {
printer.printLn();
}
}
printer.unindent();
printer.print("}");
}