You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|Any.getPropertyValue(propertyName: String): Any?|get object property value by name|
32
+
|Any.changePropertyValue(propertyName: String, newValue: Any?) |change object property value by name|
33
+
|Any.changePropertyValueByPropertyReference(kProperty: KProperty<R>, newValue: Any?)|change object property value by name|
34
+
|Any.invokeMethod(methodName: String, vararg args: Any?): Any?|invoke a method through object by method name|
35
+
|<R> KProperty<R>.changeValue(thisObj: Any, newValue: Any?)|change current this property valuev|
36
+
|<R> KProperty<R>.packageLevelGetPropertyValueByName(otherPropertyName: String): Any? |get other package level property value by other package level property name which is in the same kotlin file|
37
+
|<R> KFunction<R>.packageLevelGetPropertyValueByName(otherPropertyName: String): Any?|get other package level property value by other package level property name which is in the same kotlin file|
|<R> KProperty<R>.packageLevelChangeOtherPropertyValueByName(otherPropertyName: String, newValue: Any?)|change other package level property value by other package level property name which is in the same kotlin file|
40
+
|<R> KFunction<R>.packageLevelChangeOtherPropertyValueByName(otherPropertyName: String, newValue: Any?)|change other package level property value by other package level property name which is in the same kotlin file|
41
+
|<R> KProperty<R>.packageLevelInvokeMethodByName(methodName: String, vararg args: Any?): Any? |invoke package level method by name which is in the same kotlin file|
42
+
|<R> KFunction<R>.packageLevelInvokeMethodByName(methodName: String, vararg args: Any?): Any?|invoke package level method by name which is in the same kotlin file|
27
43
28
-
|Method |Describe |
29
-
|:------------- |:-------------|
44
+
45
+
## APIs
46
+
### API since 1.1
47
+
48
+
|Method | Describe |
49
+
| ------------- |:-------------|
30
50
|changeTopPropertyValue | change the top level property value |
31
51
| changeTopPropertyValueByName | change the top leve property name by porpery name |
32
52
| getTopPropertyValueByName | get the top level property value by property name |
@@ -41,19 +61,12 @@ All method don't care what the property or method visibility it is
41
61
## Demo
42
62
For example a Kotlin file like this:
43
63
```kotlin
64
+
44
65
val topName = "topSeal"
66
+
val topNameWu = "topSealWu"
45
67
private val topAge = 666
46
-
private val topAgeName = "666"
47
-
private fun preTopAge(): Int {
48
-
return funPropertyReduceAge(topAge)
49
-
}
50
-
private fun nextTopAge(): Int {
51
-
return funPropertyPlusAge(topAge)
52
-
}
53
68
54
-
val funPropertyPlusAge: (Int) -> Int = { age -> age + 1 }
55
-
56
-
val funPropertyReduceAge: (Int) -> Int = { age -> age - 1 }
0 commit comments