New J2K: Add EnumClassConversion
This commit is contained in:
committed by
Ilya Kirillov
parent
17b96b8240
commit
7dd60a04ec
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.j2k.conversions
|
||||
|
||||
import org.jetbrains.kotlin.j2k.tree.*
|
||||
import org.jetbrains.kotlin.j2k.tree.impl.JKExpressionStatementImpl
|
||||
import org.jetbrains.kotlin.j2k.tree.impl.JKKtThrowExpressionImpl
|
||||
|
||||
|
||||
class EnumClassConversion : RecursiveApplicableConversionBase() {
|
||||
override fun applyToElement(element: JKTreeElement): JKTreeElement {
|
||||
if (element !is JKClass || element.classKind != JKClass.ClassKind.ENUM) return recurse(element)
|
||||
element.modality = Modality.FINAL
|
||||
return recurse(element)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user