Search in sources :

Example 1 with TypeParameterMirror

use of com.redhat.ceylon.model.loader.mirror.TypeParameterMirror in project ceylon-compiler by ceylon.

the class JavacUtil method getTypeParameters.

public static List<TypeParameterMirror> getTypeParameters(Symbol symbol) {
    try {
        com.sun.tools.javac.util.List<TypeSymbol> typeParameters = symbol.getTypeParameters();
        List<TypeParameterMirror> ret = new ArrayList<TypeParameterMirror>(typeParameters.size());
        for (TypeSymbol typeParameter : typeParameters) ret.add(new JavacTypeParameter(typeParameter));
        return ret;
    } catch (CompletionFailure x) {
        throw new ModelResolutionException("Failed to load type parameters", x);
    }
}
Also used : ModelResolutionException(com.redhat.ceylon.model.loader.ModelResolutionException) TypeParameterMirror(com.redhat.ceylon.model.loader.mirror.TypeParameterMirror) CompletionFailure(com.sun.tools.javac.code.Symbol.CompletionFailure) ArrayList(java.util.ArrayList) TypeSymbol(com.sun.tools.javac.code.Symbol.TypeSymbol)

Aggregations

ModelResolutionException (com.redhat.ceylon.model.loader.ModelResolutionException)1 TypeParameterMirror (com.redhat.ceylon.model.loader.mirror.TypeParameterMirror)1 CompletionFailure (com.sun.tools.javac.code.Symbol.CompletionFailure)1 TypeSymbol (com.sun.tools.javac.code.Symbol.TypeSymbol)1 ArrayList (java.util.ArrayList)1