Hello
I'm trying to find an easy solution for this:
I want to read a json file, and update an object accordingly. I made a small example of what I want to achieve. In my example I have a User class I want to alter:
I'm calling this code this way:
Does anyone knows what is wrong here, It's the first time I use this reflection library: https://www.b4x.com/b4j/help/jreflection.html
The error is:
Thank you!
I'm trying to find an easy solution for this:
I want to read a json file, and update an object accordingly. I made a small example of what I want to achieve. In my example I have a User class I want to alter:
B4X:
Sub Class_Globals
Private mFirstname As String
Private mLastname As String
End Sub
Public Sub Initialize(Firstname As String, Lastname As String)
mFirstname = Firstname
mLastname = Lastname
End Sub
Public Sub getFirstname As String
Return mFirstname
End Sub
Public Sub getLasttname As String
Return mLastname
End Sub
Public Sub UpdateByMap(m As Map)
Dim reflect As Reflector
reflect.Target = Me
For Each key As String In m.Keys
reflect.SetField2("m" & key, m.Get(key))
Next
End Sub
I'm calling this code this way:
B4X:
Sub AppStart (Args() As String)
Dim u As User
u.Initialize("Tom", "Jones")
Dim m As Map
m.Initialize
m.Put("Firstname", "Matt")
u.UpdateByMap(m)
Log(u.Firstname & " " & u.Lastname)
StartMessageLoop
End Sub
Does anyone knows what is wrong here, It's the first time I use this reflection library: https://www.b4x.com/b4j/help/jreflection.html
The error is:
java.lang.NoClassDefFoundError: javafx/beans/value/ChangeListener
Thank you!