Using JNI or some other tool, is it possible to achieve Reflection of C code in Java? -


hello , taking time help, appreciated.

i have many populated structs written in c. need convert them json name of variable key, , value value. have researched far, there no optimal way achieve this, , looks loop each struct need hard coded obtain json result.

however, appears using reflection (not supported c), each of objects can accessed @ run-time in way making json string loop possible.

is possible use java reflection using jni or other tool solve problem, , allow access structs @ runtime?

short answer: no.

long answer: fact concept (reflection; , meta data being available @ run time within java class files) exists in 1 language ... , fact 1 language (java) has concept call (or called) binaries build c doesn't mean first concept magically available on c side. know, having bridge on river doesn't move building located on 1 shore other side.

it might more reasonable think building kind of parser analyses c code; , derives json information source (code).


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -