Search in sources :

Example 1 with ClassOrInterfaceImpl

use of org.eclipse.ceylon.compiler.java.runtime.metamodel.meta.ClassOrInterfaceImpl in project ceylon by eclipse.

the class Metamodel method getReflectedAnnotationClass.

/**
 * returns the java.lang.Class of the given the Ceylon metamodel of
 * an annotation class.
 */
public static <Value extends java.lang.annotation.Annotation, Values, ProgramElement extends Annotated> Class<?> getReflectedAnnotationClass(ClassOrInterface<? extends java.lang.annotation.Annotation> annotationType) {
    ClassOrInterfaceDeclarationImpl freeClass;
    if (annotationType instanceof ClassOrInterfaceImpl) {
        freeClass = (ClassOrInterfaceDeclarationImpl) ((ClassOrInterfaceImpl<?>) annotationType).getDeclaration();
    } else {
        freeClass = (ClassOrInterfaceDeclarationImpl) annotationType;
    }
    final Class<?> refAnnotationClass = getJavaClass(freeClass.declaration);
    return refAnnotationClass;
}
Also used : ClassOrInterfaceImpl(org.eclipse.ceylon.compiler.java.runtime.metamodel.meta.ClassOrInterfaceImpl) ClassOrInterfaceDeclarationImpl(org.eclipse.ceylon.compiler.java.runtime.metamodel.decl.ClassOrInterfaceDeclarationImpl)

Aggregations

ClassOrInterfaceDeclarationImpl (org.eclipse.ceylon.compiler.java.runtime.metamodel.decl.ClassOrInterfaceDeclarationImpl)1 ClassOrInterfaceImpl (org.eclipse.ceylon.compiler.java.runtime.metamodel.meta.ClassOrInterfaceImpl)1