Java To Kotlin: KtLightModifierList
This commit is contained in:
+2
-3
@@ -263,9 +263,8 @@ open class KtLightClassForExplicitDeclaration(
|
|||||||
|
|
||||||
private val _modifierList : PsiModifierList by lazy {
|
private val _modifierList : PsiModifierList by lazy {
|
||||||
object : KtLightModifierList(this.manager, computeModifiers()) {
|
object : KtLightModifierList(this.manager, computeModifiers()) {
|
||||||
override fun getDelegate(): PsiModifierList {
|
override val delegate: PsiAnnotationOwner
|
||||||
return this@KtLightClassForExplicitDeclaration.getDelegate().modifierList!!
|
get() = this@KtLightClassForExplicitDeclaration.getDelegate().modifierList!!
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,45 +14,26 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.asJava;
|
package org.jetbrains.kotlin.asJava
|
||||||
|
|
||||||
import com.intellij.psi.PsiAnnotation;
|
import com.intellij.psi.PsiAnnotation
|
||||||
import com.intellij.psi.PsiAnnotationOwner;
|
import com.intellij.psi.PsiAnnotationOwner
|
||||||
import com.intellij.psi.PsiManager;
|
import com.intellij.psi.PsiManager
|
||||||
import com.intellij.psi.impl.light.LightModifierList;
|
import com.intellij.psi.impl.light.LightModifierList
|
||||||
import org.jetbrains.annotations.NonNls;
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.jetbrains.kotlin.idea.KotlinLanguage;
|
|
||||||
|
|
||||||
public abstract class KtLightModifierList extends LightModifierList {
|
abstract class KtLightModifierList(
|
||||||
public KtLightModifierList(PsiManager psiManager, @NotNull String[] modifiers) {
|
psiManager: PsiManager,
|
||||||
super(psiManager, KotlinLanguage.INSTANCE, modifiers);
|
modifiers: Array<String>
|
||||||
}
|
) : LightModifierList(psiManager, KotlinLanguage.INSTANCE, *modifiers) {
|
||||||
|
abstract val delegate: PsiAnnotationOwner
|
||||||
|
|
||||||
public abstract PsiAnnotationOwner getDelegate();
|
override fun getAnnotations() = delegate.annotations
|
||||||
|
|
||||||
@Override
|
override fun getApplicableAnnotations() = delegate.applicableAnnotations
|
||||||
@NotNull
|
|
||||||
public PsiAnnotation[] getAnnotations() {
|
|
||||||
return getDelegate().getAnnotations();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
override fun findAnnotation(@NonNls qualifiedName: String) = delegate.findAnnotation(qualifiedName)
|
||||||
@NotNull
|
|
||||||
public PsiAnnotation[] getApplicableAnnotations() {
|
|
||||||
return getDelegate().getApplicableAnnotations();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
override fun addAnnotation(@NonNls qualifiedName: String) = delegate.addAnnotation(qualifiedName)
|
||||||
@Nullable
|
|
||||||
public PsiAnnotation findAnnotation(@NotNull @NonNls String qualifiedName) {
|
|
||||||
return getDelegate().findAnnotation(qualifiedName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public PsiAnnotation addAnnotation(@NotNull @NonNls String qualifiedName) {
|
|
||||||
return getDelegate().addAnnotation(qualifiedName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user