I have a user defined class like the following,
package com.hexgen.tools;
public class UserDefinedParams {
private String dataType="";
private String isArray="";
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getIsArray() {
return isArray;
}
public void setIsArray(String isArray) {
this.isArray = isArray;
}
}
dataType and isArray the values for this if dataType -> this may have userdefined pojo class or java primitive type and if isArray ->this will have Y or N. based on this how to create something like:
if dataType someUserDefinedPOJO and isArray Y
-> someUserDefinedPOJO[] obj = new someUserDefinedPOJO();
vise versa for java primitive types too.
is it possible through reflection in java?
How to do this?
Best Regards
Objectcan store pretty much anything. Regardless, you'd be much better off redesigning your program such that what you're trying to do is no longer required.