From 4ef089d2ed3212a7d358d9584ca5614645ae3058 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 19 May 2014 17:46:02 +0400 Subject: [PATCH] Introduce KClass, KPackage and their JVM implementations --- core/reflection/src/kotlin/reflect/KClass.kt | 19 +++++++++++++++++ .../reflection/src/kotlin/reflect/KPackage.kt | 19 +++++++++++++++++ .../kotlin/reflect/jvm/internal/KClassImpl.kt | 21 +++++++++++++++++++ .../reflect/jvm/internal/KPackageImpl.kt | 21 +++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 core/reflection/src/kotlin/reflect/KClass.kt create mode 100644 core/reflection/src/kotlin/reflect/KPackage.kt create mode 100644 core/runtime.jvm/src/kotlin/reflect/jvm/internal/KClassImpl.kt create mode 100644 core/runtime.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt diff --git a/core/reflection/src/kotlin/reflect/KClass.kt b/core/reflection/src/kotlin/reflect/KClass.kt new file mode 100644 index 00000000000..300a7415841 --- /dev/null +++ b/core/reflection/src/kotlin/reflect/KClass.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin.reflect + +public trait KClass diff --git a/core/reflection/src/kotlin/reflect/KPackage.kt b/core/reflection/src/kotlin/reflect/KPackage.kt new file mode 100644 index 00000000000..cb176d1543c --- /dev/null +++ b/core/reflection/src/kotlin/reflect/KPackage.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin.reflect + +public trait KPackage diff --git a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/KClassImpl.kt b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/KClassImpl.kt new file mode 100644 index 00000000000..084a36d0ed1 --- /dev/null +++ b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/KClassImpl.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin.reflect.jvm.internal + +class KClassImpl( + val jClass: Class +) : KClass diff --git a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt new file mode 100644 index 00000000000..1bd38d78641 --- /dev/null +++ b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin.reflect.jvm.internal + +class KPackageImpl( + val jClass: Class<*> +) : KPackage