[jvm-lang] add documentation for CreateFieldRequest

This commit is contained in:
Daniil Ovchinnikov
2017-08-28 14:40:26 +03:00
parent c7b4b47dc9
commit ecf65d0924
@@ -19,13 +19,40 @@ import com.intellij.lang.jvm.JvmModifier
interface CreateFieldRequest {
/**
* Request may be bound to the PSI-element in call-site language,
* which means request will become invalid if element is invalidated.
*
* @return `true` if it is safe to call other methods of this object, `false` otherwise
*/
val isValid: Boolean
/**
* @return name of the field to be created
*/
val fieldName: String
/**
* The common interface is not ready yet, so this is [Any]?.
* For Java language an array of [com.intellij.codeInsight.ExpectedTypeInfo] is returned now.
*
* @return expected type info of the field to be created
*/
val fieldType: Any?
/**
* Implementation are free to render any modifiers as long as they don't contradict with requested ones.
* Example: if constant field is requested then it will be rendered
* with `static final` modifiers even if they are not present in this collection.
*
* @return modifiers that should be present when requested field is compiled
*/
val modifiers: Collection<JvmModifier>
/**
* Constant fields may be used in annotations and in other constant expressions.
*
* @return whether the field must be a compile-time constant
*/
val constant: Boolean
}