Search in sources :

Example 11 with Annotation

use of abs.frontend.ast.Annotation in project abstools by abstools.

the class AnnotationHelper method getAnnotationsOfType.

public static java.util.List<Annotation> getAnnotationsOfType(List<Annotation> annos, String qualifiedName) {
    ArrayList<Annotation> res = new ArrayList<>();
    for (Annotation a : annos) {
        if (a.getType().getQualifiedName().equals(qualifiedName)) {
            DataConstructorExp de = (DataConstructorExp) a.getValue();
            res.add(a);
        }
    }
    return res;
}
Also used : DataConstructorExp(abs.frontend.ast.DataConstructorExp) ArrayList(java.util.ArrayList) Annotation(abs.frontend.ast.Annotation)

Aggregations

Annotation (abs.frontend.ast.Annotation)11 MethodSig (abs.frontend.ast.MethodSig)6 PureExp (abs.frontend.ast.PureExp)4 AbsASTBuilderUtil.createMethodSig (abs.backend.tests.AbsASTBuilderUtil.createMethodSig)3 ClassDecl (abs.frontend.ast.ClassDecl)3 IntLiteral (abs.frontend.ast.IntLiteral)3 MethodImpl (abs.frontend.ast.MethodImpl)3 ParamDecl (abs.frontend.ast.ParamDecl)3 TypedAnnotation (abs.frontend.ast.TypedAnnotation)3 AddMethodModifier (abs.frontend.ast.AddMethodModifier)2 Block (abs.frontend.ast.Block)2 FieldUse (abs.frontend.ast.FieldUse)2 AbsASTBuilderUtil.createMethodImpl (abs.backend.tests.AbsASTBuilderUtil.createMethodImpl)1 TypeError (abs.frontend.analyser.TypeError)1 CaseBranchStmt (abs.frontend.ast.CaseBranchStmt)1 CompilationUnit (abs.frontend.ast.CompilationUnit)1 DataConstructorExp (abs.frontend.ast.DataConstructorExp)1 Decl (abs.frontend.ast.Decl)1 FieldDecl (abs.frontend.ast.FieldDecl)1 InitBlock (abs.frontend.ast.InitBlock)1