當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。