How to access fields of type array?

82 views
Skip to first unread message

nikhil chudekar

unread,
Jul 31, 2015, 1:12:49 PM7/31/15
to reflectasm-users
Hello,

I'm using RelfectASM to iterate over all the fields in a given object.
I can do that primitive types i.e. with int, double, boolean etc.
But I also want to be able to access fields of array type.

For example,
Class M {
      int []arr;
};

Then I want to be able to detect that arr field is an integer array and also access values contained in that array.
How I can do this using ReflectASM?

I'm a new user of ReflectASM, so really sorry if there is something inherently wrong with the question.

Thanks,
Nikhil

Nate

unread,
Jul 31, 2015, 1:58:27 PM7/31/15
to reflecta...@googlegroups.com
You can just use Java reflection for this. M.class.getFields(), etc.



--
You received this message because you are subscribed to the "reflectasm-users" group.
http://groups.google.com/group/reflectasm-users
---
You received this message because you are subscribed to the Google Groups "reflectasm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reflectasm-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nikhil chudekar

unread,
Jul 31, 2015, 2:12:08 PM7/31/15
to reflectasm-users, nathan...@gmail.com
Hi,

Thanks for the quick reply.

Using Java reflection would be quite heavy but, right?

Suminda Dharmasena

unread,
Sep 28, 2015, 2:24:13 AM9/28/15
to reflectasm-users, nathan...@gmail.com
This would be an useful feature to have.
Reply all
Reply to author
Forward
0 new messages