Casting objects to Integer,string ,...
- by Milan
Hello everybody!
I have one small problem. I have list of types(int,string,..)
ArrayList<Class> typeList;
and I have some input values;
ArrayList<Object> values;
How to cast some value to some type if I know which type from the typeList is the values;
typeList.get(i).cast(values.get(i)); <- this is not working???
Actualy I generate dynamic form in runtime.
With Java reflection I get parameterTypes from methods from some class, I generate form with input fields and then i want to cast the text from the input fields to specific types from the paramterTypes that I got with Java reflection from some class.