当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationMemberDeclaration类代码示例

本文整理汇总了Java中org.walkmod.javalang.ast.body.AnnotationMemberDeclaration的典型用法代码示例。如果您正苦于以下问题:Java AnnotationMemberDeclaration类的具体用法?Java AnnotationMemberDeclaration怎么用?Java AnnotationMemberDeclaration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AnnotationMemberDeclaration类属于org.walkmod.javalang.ast.body包,在下文中一共展示了AnnotationMemberDeclaration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
@Override
public void visit(AnnotationMemberDeclaration 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);
        }
    }
    n.getType().accept(expressionTypeAnalyzer, arg);

    Expression expr = n.getDefaultValue();
    if (expr != null) {
        expr.accept(expressionTypeAnalyzer, arg);
    }
}
 
开发者ID:rpau,项目名称:javalang-compiler,代码行数:19,代码来源:SymbolVisitorAdapter.java

示例2: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public Boolean visit(AnnotationMemberDeclaration n1, Node arg) {
    AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg;
    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 (!nodeEquals(n1.getDefaultValue(), n2.getDefaultValue())) {
        return Boolean.FALSE;
    }
    if (!nodeEquals(n1.getType(), n2.getType())) {
        return Boolean.FALSE;
    }
    return Boolean.TRUE;
}
 
开发者ID:rpau,项目名称:javalang,代码行数:20,代码来源:EqualsVisitor.java

示例3: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public Node visit(AnnotationMemberDeclaration 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);
    }
    n.setType((Type) n.getType().accept(this, arg));
    if (n.getDefaultValue() != null) {
        n.setDefaultValue((Expression) n.getDefaultValue().accept(this, arg));
    }
    return n;
}
 
开发者ID:rpau,项目名称:javalang,代码行数:18,代码来源:ModifierVisitorAdapter.java

示例4: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public R visit(AnnotationMemberDeclaration 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);
        }
    }
    n.getType().accept(this, arg);
    if (n.getDefaultValue() != null) {
        n.getDefaultValue().accept(this, arg);
    }
    return null;
}
 
开发者ID:rpau,项目名称:javalang,代码行数:16,代码来源:GenericVisitorAdapter.java

示例5: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
@Override
public Node visit(AnnotationMemberDeclaration _n, Object _arg) {
    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    Type type_ = cloneNodes(_n.getType(), _arg);
    Expression defaultValue = cloneNodes(_n.getDefaultValue(), _arg);
    AnnotationMemberDeclaration r =
            new AnnotationMemberDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(),
                    _n.getEndColumn(), javaDoc, _n.getModifiers(), annotations, type_, _n.getName(), defaultValue);
    return r;
}
 
开发者ID:rpau,项目名称:javalang,代码行数:12,代码来源:CloneVisitor.java

示例6: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public void visit(AnnotationMemberDeclaration n, Object arg) {
    prepareComments(n);
    JavadocComment comment = n.getJavaDoc();

    if (comment != null) {
        printPreviousComments(comment, arg);
    }

    printJavadoc(comment, arg);
    if (comment != null && !n.isNewNode() && !comment.isNewNode()) {
        int start = comment.getEndLine();
        int end = n.getBeginLine();
        for (int i = start + 1; i < end; i++) {
            printer.printLn();
        }
    }
    printMemberAnnotations(n.getAnnotations(), arg);
    printModifiers(n.getModifiers());
    n.getType().accept(this, arg);
    printer.print(" ");
    printer.print(n.getName());
    printer.print("()");
    if (n.getDefaultValue() != null) {
        printer.print(" default ");
        n.getDefaultValue().accept(this, arg);
    }
    printer.print(";");
}
 
开发者ID:rpau,项目名称:javalang,代码行数:29,代码来源:DumpVisitor.java

示例7: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public void visit(AnnotationMemberDeclaration 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);
        }
    }
    n.getType().accept(this, arg);
    if (n.getDefaultValue() != null) {
        n.getDefaultValue().accept(this, arg);
    }
}
 
开发者ID:rpau,项目名称:javalang,代码行数:15,代码来源:VoidVisitorAdapter.java

示例8: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public void visit(AnnotationMemberDeclaration n, VisitorContext arg) {
    if (preVisitor != null) {
        preVisitor.visit(n, arg);
    }
    super.visit(n, arg);
    if (postVisitor != null) {
        postVisitor.visit(n, arg);
    }
}
 
开发者ID:rpau,项目名称:javalang,代码行数:10,代码来源:CompositeVisitor.java

示例9: compare

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
@Override
public int compare(AnnotationMemberDeclaration an1, AnnotationMemberDeclaration an2) {
    if (an1.getName() == null || an2.getName() == null) {
        throw new IllegalArgumentException(
                "Annotation member must have a name in order to compare them" + an1 + "-" + an2);
    }
    return an1.getName().compareTo(an2.getName());
}
 
开发者ID:rpau,项目名称:javalang,代码行数:9,代码来源:AnnotationMemberDeclarationComparator.java

示例10: AnnotationTypeMemberDeclaration

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier) throws ParseException {
    Type type;
    String name;
    Expression defaultVal = null;
    type = Type();
    jj_consume_token(IDENTIFIER);
    name = token.image;
    jj_consume_token(LPAREN);
    jj_consume_token(RPAREN);
    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
        case _DEFAULT:
            defaultVal = DefaultValue();
            break;
        default:
            jj_la1[174] = jj_gen;;
    }
    jj_consume_token(SEMICOLON);
    int line = modifier.beginLine;
    int column = modifier.beginColumn;
    {
        if (line == -1) {
            line = type.getBeginLine();
            column = type.getBeginColumn();
        }
    }
    {
        if (true)
            return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(),
                    modifier.modifiers, modifier.annotations, type, name, defaultVal);
    }
    throw new Error("Missing return statement in function");
}
 
开发者ID:rpau,项目名称:javalang,代码行数:33,代码来源:ASTParser.java

示例11: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public void visit(AnnotationMemberDeclaration n, VisitorContext ctx) {
    Object o = ctx.get(NODE_TO_COMPARE_KEY);
    if (o != null && o instanceof AnnotationMemberDeclaration) {
        boolean backup = isUpdated();
        setIsUpdated(false);
        AnnotationMemberDeclaration aux = (AnnotationMemberDeclaration) o;

        boolean equals = n.getName().equals(aux.getName()) && n.getModifiers() == aux.getModifiers();
        Position pos = popPosition();
        pushPosition(aux);
        inferASTChanges(n.getJavaDoc(), aux.getJavaDoc());
        inferASTChanges(n.getAnnotations(), aux.getAnnotations());
        inferASTChanges(n.getDefaultValue(), aux.getDefaultValue());
        inferASTChanges(n.getType(), aux.getType());
        popPosition();
        pushPosition(pos);
        if (!equals) {
            applyUpdate(n, (Node) o);
        }
        if (!isUpdated()) {
            if (equals) {
                increaseUnmodifiedNodes(AnnotationMemberDeclaration.class);
            } else {
                increaseUpdatedNodes(AnnotationMemberDeclaration.class);
            }
        } else {
            increaseUpdatedNodes(AnnotationMemberDeclaration.class);
        }
        setIsUpdated(backup || isUpdated());
    } else if (o != null) {
        setIsUpdated(true);
        applyUpdate(n, (Node) o);
    }
}
 
开发者ID:walkmod,项目名称:walkmod-javalang-plugin,代码行数:35,代码来源:ChangeLogVisitor.java

示例12: getActions

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
@Override
public List<SymbolAction> getActions(AnnotationMemberDeclaration n) {
    buildActionList();
    return actions;
}
 
开发者ID:rpau,项目名称:javalang-compiler,代码行数:6,代码来源:RemoveUnusedSymbolsProvider.java

示例13: getActions

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public List<SymbolAction> getActions(AnnotationMemberDeclaration n); 
开发者ID:rpau,项目名称:javalang-compiler,代码行数:2,代码来源:SymbolActionProvider.java

示例14: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public R visit(AnnotationMemberDeclaration n, A arg); 
开发者ID:rpau,项目名称:javalang,代码行数:2,代码来源:GenericVisitor.java

示例15: visit

import org.walkmod.javalang.ast.body.AnnotationMemberDeclaration; //导入依赖的package包/类
public void visit(AnnotationMemberDeclaration n, A arg); 
开发者ID:rpau,项目名称:javalang,代码行数:2,代码来源:VoidVisitor.java


注:本文中的org.walkmod.javalang.ast.body.AnnotationMemberDeclaration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。