Introduce KAnnotatedElement and val annotations: List<Annotation>

This commit is contained in:
Alexander Udalov
2015-07-24 03:09:36 +03:00
parent d1e67805fc
commit 2eb5201575
21 changed files with 246 additions and 6 deletions
@@ -23,6 +23,7 @@ import kotlin.reflect.KParameter;
import kotlin.reflect.KType;
import org.jetbrains.annotations.NotNull;
import java.lang.annotation.Annotation;
import java.util.List;
/**
@@ -75,6 +76,11 @@ public abstract class CallableReference implements KCallable {
throw error();
}
@Override
public List<Annotation> getAnnotations() {
throw error();
}
@Override
public Object call(@NotNull Object... args) {
throw error();
@@ -33,5 +33,8 @@ public class ClassReference(override val jClass: Class<*>) : KClass<Any>, Declar
override val constructors: Collection<KFunction<Any>>
get() = error()
override val annotations: List<Annotation>
get() = error()
private fun error(): Nothing = throw KotlinReflectionNotSupportedError()
}
@@ -20,6 +20,7 @@ import kotlin.jvm.KotlinReflectionNotSupportedError;
import kotlin.reflect.*;
import org.jetbrains.annotations.NotNull;
import java.lang.annotation.Annotation;
import java.util.List;
@SuppressWarnings("deprecation")
@@ -71,6 +72,11 @@ public class FunctionReference
throw error();
}
@Override
public List<Annotation> getAnnotations() {
throw error();
}
@Override
public Object call(@NotNull Object... args) {
throw error();