I am using ksoap2, and when I get a soap object that looks like:
params=anyType
{
defaultValueString=10;
label=Number of search results;
optional=true;
PRName=Yahoo PR;
paramName=limit;
pipelineName=Yahoo Search;
type=int;
};
I try to change some fields in class using reflection, by using method setAttr:
The setAttr method is written:
public void setAttr(Object tag,Object value)
{
Field dynamicSet = gateRuntimeParameter.class.getField((String)tag);
dynamicSet.set(new gateRuntimeParameter(), value);
}
The problem is tag would sometimes be lets say: boolean, but value is an soapprimitve object type...
How can I cast value using field getType, i.e. something like: (dynamicSet.getType())value?