为什么有些 Java setter 方法会自动成为 Kotlin 属性,而有些则不会?

Why do some Java setter methods automatically become Kotlin properties but some don't?

例如这 WebSettings Java class。

它有一个 Java 方法 setJavaScriptEnabled(boolean) 变成 Kotlin 属性 javaScriptEnabled 如下,但也有 setSupportZoom(boolean) 不转进入 Kotlin 属性 supportZoom.

        settings.javaScriptEnabled = true
        settings.domStorageEnabled = true
        settings.setSupportZoom(false)
        settings.builtInZoomControls = false
        settings.setSupportMultipleWindows(true)

来自documentation

Boolean accessor methods (where the name of the getter starts with is and the name of the setter starts with set) are represented as properties which have the same name as the getter method.

从 Kotlin 1.2.0 开始:

Note that, if the Java class only has a setter, it will not be visible as a property in Kotlin, because Kotlin does not support set-only properties at this time.

签名boolean isSupportMultipleWindows()的Javaclass中没有方法,boolean supportMultipleWindows()与Kotlin中的属性表示不匹配。