本文整理汇总了Java中japa.parser.ast.body.EnumConstantDeclaration类的典型用法代码示例。如果您正苦于以下问题:Java EnumConstantDeclaration类的具体用法?Java EnumConstantDeclaration怎么用?Java EnumConstantDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumConstantDeclaration类属于japa.parser.ast.body包,在下文中一共展示了EnumConstantDeclaration类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
public R visit(EnumConstantDeclaration n, A arg) {
if (n.getJavaDoc() != null) {
n.getJavaDoc().accept(this, arg);
}
if (n.getAnnotations() != null) {
for (AnnotationExpr a : n.getAnnotations()) {
a.accept(this, arg);
}
}
if (n.getArgs() != null) {
for (Expression e : n.getArgs()) {
e.accept(this, arg);
}
}
if (n.getClassBody() != null) {
for (BodyDeclaration member : n.getClassBody()) {
member.accept(this, arg);
}
}
return null;
}
开发者ID:rfw,项目名称:genja,代码行数:22,代码来源:GenericVisitorAdapter.java
示例2: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
public Boolean visit(EnumConstantDeclaration n1, Node arg) {
EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg;
// javadoc are checked at CompilationUnit
if (!objEquals(n1.getName(), n2.getName())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getArgs(), n2.getArgs())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
开发者ID:rfw,项目名称:genja,代码行数:24,代码来源:EqualsVisitor.java
示例3: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
public void visit(EnumConstantDeclaration n, Object arg) {
printJavadoc(n.getJavaDoc(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printer.print(n.getName());
if (n.getArgs() != null) {
printArguments(n.getArgs(), arg);
}
if (n.getClassBody() != null) {
printer.printLn(" {");
printer.indent();
printMembers(n.getClassBody(), arg);
printer.unindent();
printer.printLn("}");
}
}
开发者ID:rfw,项目名称:genja,代码行数:18,代码来源:DumpVisitor.java
示例4: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
public void visit(EnumConstantDeclaration n, A arg) {
if (n.getJavaDoc() != null) {
n.getJavaDoc().accept(this, arg);
}
if (n.getAnnotations() != null) {
for (AnnotationExpr a : n.getAnnotations()) {
a.accept(this, arg);
}
}
if (n.getArgs() != null) {
for (Expression e : n.getArgs()) {
e.accept(this, arg);
}
}
if (n.getClassBody() != null) {
for (BodyDeclaration member : n.getClassBody()) {
member.accept(this, arg);
}
}
}
开发者ID:rfw,项目名称:genja,代码行数:21,代码来源:VoidVisitorAdapter.java
示例5: addEnumConstant
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
private void addEnumConstant(final List<EnumConstantDeclaration> constants,
final JavaSymbolName name) {
// Determine location to insert
for (final EnumConstantDeclaration constant : constants) {
if (constant.getName().equals(name.getSymbolName())) {
throw new IllegalArgumentException("Enum constant '"
+ name.getSymbolName() + "' already exists");
}
}
final EnumConstantDeclaration newEntry = new EnumConstantDeclaration(
name.getSymbolName());
constants.add(constants.size(), newEntry);
}
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:14,代码来源:JavaParserTypeParsingService.java
示例6: getName
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
private static String getName(BodyDeclaration decl) {
if (decl instanceof AnnotationMemberDeclaration) {
return ((AnnotationMemberDeclaration) decl).getName();
}
if (decl instanceof ConstructorDeclaration) {
return ((ConstructorDeclaration) decl).getName();
}
if (decl instanceof EnumConstantDeclaration) {
return ((EnumConstantDeclaration) decl).getName();
}
if (decl instanceof FieldDeclaration) {
List<VariableDeclarator> variables = ((FieldDeclaration) decl).getVariables();
if (variables.size() == 1) {
return variables.get(0).getId().getName();
} else {
return null;
}
}
if (decl instanceof MethodDeclaration) {
return ((MethodDeclaration) decl).getName();
}
if (decl instanceof AnnotationDeclaration) {
return ((AnnotationDeclaration) decl).getName();
}
if (decl instanceof ClassOrInterfaceDeclaration) {
return ((ClassOrInterfaceDeclaration) decl).getName();
}
if (decl instanceof EnumDeclaration) {
return ((EnumDeclaration) decl).getName();
}
return null;
}
开发者ID:jedwards1211,项目名称:breakout,代码行数:33,代码来源:JavaParserUtils.java
示例7: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
public Node visit(EnumConstantDeclaration n, A arg) {
if (n.getJavaDoc() != null) {
n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg));
}
List<AnnotationExpr> annotations = n.getAnnotations();
if (annotations != null) {
for (int i = 0; i < annotations.size(); i++) {
annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg));
}
removeNulls(annotations);
}
List<Expression> args = n.getArgs();
if (args != null) {
for (int i = 0; i < args.size(); i++) {
args.set(i, (Expression) args.get(i).accept(this, arg));
}
removeNulls(args);
}
List<BodyDeclaration> classBody = n.getClassBody();
if (classBody != null) {
for (int i = 0; i < classBody.size(); i++) {
classBody.set(i, (BodyDeclaration) classBody.get(i).accept(this, arg));
}
removeNulls(classBody);
}
return n;
}
开发者ID:rfw,项目名称:genja,代码行数:28,代码来源:ModifierVisitorAdapter.java
示例8: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
@Override
public void visit(EnumConstantDeclaration n, Generator arg) {
throw new TransformException("don't know how to linearize");
}
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:LinearizeTransform.java
示例9: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
@Override
public Boolean visit(EnumConstantDeclaration n, Void arg) {
return false;
}
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:NodeAnnotator.java
示例10: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
@Override
public void visit(EnumConstantDeclaration n, Scope arg) {
// TODO Auto-generated method stub
super.visit(n, arg);
}
开发者ID:rfw,项目名称:genja,代码行数:6,代码来源:ScopeCollector.java
示例11: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
@Override
public void visit(EnumConstantDeclaration n, Object arg) {
doTest(source, n);
super.visit(n, arg);
}
开发者ID:rfw,项目名称:genja,代码行数:6,代码来源:TestNodePositions.java
示例12: visitPre
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
@Override
public void visitPre(EnumConstantDeclaration n, A arg) {
}
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java
示例13: visitPost
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
@Override
public void visitPost(EnumConstantDeclaration n, A arg) {
}
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java
示例14: visitPre
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
void visitPre(EnumConstantDeclaration n, A arg);
开发者ID:kuali,项目名称:kc-rice,代码行数:2,代码来源:VoidVisitorHelper.java
示例15: visitPost
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
void visitPost(EnumConstantDeclaration n, A arg);
开发者ID:kuali,项目名称:kc-rice,代码行数:2,代码来源:VoidVisitorHelper.java
示例16: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
public R visit(EnumConstantDeclaration n, A arg);
开发者ID:rfw,项目名称:genja,代码行数:2,代码来源:GenericVisitor.java
示例17: visit
import japa.parser.ast.body.EnumConstantDeclaration; //导入依赖的package包/类
public void visit(EnumConstantDeclaration n, A arg);
开发者ID:rfw,项目名称:genja,代码行数:2,代码来源:VoidVisitor.java
注:本文中的japa.parser.ast.body.EnumConstantDeclaration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论