本文整理汇总了Java中japa.parser.ast.body.EnumDeclaration类的典型用法代码示例。如果您正苦于以下问题:Java EnumDeclaration类的具体用法?Java EnumDeclaration怎么用?Java EnumDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumDeclaration类属于japa.parser.ast.body包,在下文中一共展示了EnumDeclaration类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getJavaMethods
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
private void getJavaMethods (ArrayList<JavaMethod> methods, TypeDeclaration type) {
classStack.push(type);
if (type.getMembers() != null) {
for (BodyDeclaration member : type.getMembers()) {
if (member instanceof ClassOrInterfaceDeclaration || member instanceof EnumDeclaration) {
getJavaMethods(methods, (TypeDeclaration)member);
} else {
if (member instanceof MethodDeclaration) {
MethodDeclaration method = (MethodDeclaration)member;
if (!ModifierSet.hasModifier(((MethodDeclaration)member).getModifiers(), ModifierSet.NATIVE)) continue;
methods.add(createMethod(method));
}
}
}
}
classStack.pop();
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:18,代码来源:RobustJavaMethodParser.java
示例2: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
public R visit(EnumDeclaration 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.getImplements() != null) {
for (ClassOrInterfaceType c : n.getImplements()) {
c.accept(this, arg);
}
}
if (n.getEntries() != null) {
for (EnumConstantDeclaration e : n.getEntries()) {
e.accept(this, arg);
}
}
if (n.getMembers() != null) {
for (BodyDeclaration member : n.getMembers()) {
member.accept(this, arg);
}
}
return null;
}
开发者ID:rfw,项目名称:genja,代码行数:27,代码来源:GenericVisitorAdapter.java
示例3: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
public void visit(EnumDeclaration 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.getImplements() != null) {
for (ClassOrInterfaceType c : n.getImplements()) {
c.accept(this, arg);
}
}
if (n.getEntries() != null) {
for (EnumConstantDeclaration e : n.getEntries()) {
e.accept(this, arg);
}
}
if (n.getMembers() != null) {
for (BodyDeclaration member : n.getMembers()) {
member.accept(this, arg);
}
}
}
开发者ID:rfw,项目名称:genja,代码行数:26,代码来源:VoidVisitorAdapter.java
示例4: getName
import japa.parser.ast.body.EnumDeclaration; //导入依赖的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
示例5: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
public Boolean visit(EnumDeclaration n1, Node arg) {
EnumDeclaration n2 = (EnumDeclaration) arg;
// javadoc are checked at CompilationUnit
if (n1.getModifiers() != n2.getModifiers()) {
return Boolean.FALSE;
}
if (!objEquals(n1.getName(), n2.getName())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getImplements(), n2.getImplements())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getEntries(), n2.getEntries())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getMembers(), n2.getMembers())) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
开发者ID:rfw,项目名称:genja,代码行数:32,代码来源:EqualsVisitor.java
示例6: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
public Node visit(EnumDeclaration 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<ClassOrInterfaceType> implementz = n.getImplements();
if (implementz != null) {
for (int i = 0; i < implementz.size(); i++) {
implementz.set(i, (ClassOrInterfaceType) implementz.get(i).accept(this, arg));
}
removeNulls(implementz);
}
List<EnumConstantDeclaration> entries = n.getEntries();
if (entries != null) {
for (int i = 0; i < entries.size(); i++) {
entries.set(i, (EnumConstantDeclaration) entries.get(i).accept(this, arg));
}
removeNulls(entries);
}
List<BodyDeclaration> members = n.getMembers();
if (members != null) {
for (int i = 0; i < members.size(); i++) {
members.set(i, (BodyDeclaration) members.get(i).accept(this, arg));
}
removeNulls(members);
}
return n;
}
开发者ID:rfw,项目名称:genja,代码行数:35,代码来源:ModifierVisitorAdapter.java
示例7: getOuterClass
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
private TypeDeclaration getOuterClass (CompilationUnit unit) {
for (TypeDeclaration type : unit.getTypes()) {
if (type instanceof ClassOrInterfaceDeclaration || type instanceof EnumDeclaration) return type;
}
throw new RuntimeException("Couldn't find class, is your java file empty?");
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:7,代码来源:RobustJavaMethodParser.java
示例8: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
@Override
public void visit(EnumDeclaration 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.EnumDeclaration; //导入依赖的package包/类
@Override
public Boolean visit(EnumDeclaration n, Void arg) {
return false;
}
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:NodeAnnotator.java
示例10: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
@Override
public void visit(EnumDeclaration 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.EnumDeclaration; //导入依赖的package包/类
public void visit(EnumDeclaration n, Object 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 (Iterator<ClassOrInterfaceType> i = n.getImplements().iterator(); i.hasNext();) {
ClassOrInterfaceType c = i.next();
c.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.printLn(" {");
printer.indent();
if (n.getEntries() != null) {
printer.printLn();
for (Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
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("}");
}
开发者ID:rfw,项目名称:genja,代码行数:43,代码来源:DumpVisitor.java
示例12: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
@Override
public void visit(EnumDeclaration n, Object arg) {
doTest(source, n);
super.visit(n, arg);
}
开发者ID:rfw,项目名称:genja,代码行数:6,代码来源:TestNodePositions.java
示例13: visitPre
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
@Override
public void visitPre(EnumDeclaration n, A arg) {
}
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java
示例14: visitPost
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
@Override
public void visitPost(EnumDeclaration n, A arg) {
}
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java
示例15: visitPre
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
void visitPre(EnumDeclaration n, A arg);
开发者ID:kuali,项目名称:kc-rice,代码行数:2,代码来源:VoidVisitorHelper.java
示例16: visitPost
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
void visitPost(EnumDeclaration n, A arg);
开发者ID:kuali,项目名称:kc-rice,代码行数:2,代码来源:VoidVisitorHelper.java
示例17: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
public R visit(EnumDeclaration n, A arg);
开发者ID:rfw,项目名称:genja,代码行数:2,代码来源:GenericVisitor.java
示例18: visit
import japa.parser.ast.body.EnumDeclaration; //导入依赖的package包/类
public void visit(EnumDeclaration n, A arg);
开发者ID:rfw,项目名称:genja,代码行数:2,代码来源:VoidVisitor.java
注:本文中的japa.parser.ast.body.EnumDeclaration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论