Add val KClass.staticProperties: Collection<KProperty0<*>>
To get static fields from Java classes
This commit is contained in:
@@ -114,6 +114,16 @@ public val KClass<*>.declaredMemberExtensionFunctions: Collection<KFunction<*>>
|
||||
.filterIsInstance<KFunction<*>>()
|
||||
.toList()
|
||||
|
||||
/**
|
||||
* Returns static properties declared in this class.
|
||||
* Only properties representing static fields of Java classes are considered static.
|
||||
*/
|
||||
public val KClass<*>.staticProperties: Collection<KProperty0<*>>
|
||||
get() = (this as KClassImpl)
|
||||
.getMembers(staticScope, declaredOnly = false, nonExtensions = true, extensions = false)
|
||||
.filterIsInstance<KProperty0<*>>()
|
||||
.toList()
|
||||
|
||||
/**
|
||||
* Returns non-extension properties declared in this class and all of its superclasses.
|
||||
*/
|
||||
|
||||
@@ -149,7 +149,8 @@ object RuntimeTypeMapper {
|
||||
}
|
||||
}
|
||||
|
||||
fun mapPropertySignature(property: PropertyDescriptor): JvmPropertySignature {
|
||||
fun mapPropertySignature(possiblyOverriddenProperty: PropertyDescriptor): JvmPropertySignature {
|
||||
val property = DescriptorUtils.unwrapFakeOverride(possiblyOverriddenProperty)
|
||||
if (property is DeserializedPropertyDescriptor) {
|
||||
val proto = property.proto
|
||||
if (!proto.hasExtension(JvmProtoBuf.propertySignature)) {
|
||||
|
||||
Reference in New Issue
Block a user