Search in sources :

Example 21 with ClassNode

use of kalang.ast.ClassNode in project kalang by kasonyang.

the class ClassType method getTypeArgumentsMap.

public Map<GenericType, Type> getTypeArgumentsMap() {
    ClassNode clz = getClassNode();
    GenericType[] gts = clz.getGenericTypes();
    Map<GenericType, Type> ret = new HashMap();
    if (typeArguments.length > 0) {
        for (int i = 0; i < gts.length; i++) {
            ret.put(gts[i], typeArguments[i]);
        }
    }
    return ret;
}
Also used : ClassNode(kalang.ast.ClassNode) HashMap(java.util.HashMap)

Aggregations

ClassNode (kalang.ast.ClassNode)21 ObjectType (kalang.core.ObjectType)8 Nullable (javax.annotation.Nullable)4 ClassType (kalang.core.ClassType)4 Token (org.antlr.v4.runtime.Token)4 BlockStmt (kalang.ast.BlockStmt)3 ArrayType (kalang.core.ArrayType)3 GenericType (kalang.core.GenericType)3 Type (kalang.core.Type)3 LinkedList (java.util.LinkedList)2 Nonnull (javax.annotation.Nonnull)2 AssignExpr (kalang.ast.AssignExpr)2 ConstExpr (kalang.ast.ConstExpr)2 ExprNode (kalang.ast.ExprNode)2 ExprStmt (kalang.ast.ExprStmt)2 MethodNode (kalang.ast.MethodNode)2 Statement (kalang.ast.Statement)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 AmbiguousMethodException (kalang.AmbiguousMethodException)1