Search in sources :

Example 1 with TypeVariableSymbol

use of org.eclipse.ceylon.langtools.tools.javac.code.Symbol.TypeVariableSymbol in project ceylon by eclipse.

the class JavacUtil method getTypeParameters.

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

Aggregations

ArrayList (java.util.ArrayList)1 CompletionFailure (org.eclipse.ceylon.langtools.tools.javac.code.Symbol.CompletionFailure)1 TypeVariableSymbol (org.eclipse.ceylon.langtools.tools.javac.code.Symbol.TypeVariableSymbol)1 ModelResolutionException (org.eclipse.ceylon.model.loader.ModelResolutionException)1 TypeParameterMirror (org.eclipse.ceylon.model.loader.mirror.TypeParameterMirror)1