Hello,
could someone please provide inputs if there a possibility for getting all the field names as
keyset so that need not hardcode the formDataObject keys as per below??
1>
I have a form json data and have created
public class FormRequestJsonData {
@SerializedName("field1")
private String field1;
@SerializedName("field2")
private String field2;
....
@SerializedName("field20")
private String field20;
}
2>for the JsonObject
content
{
"field1" : "string",
"field2" : "string",
....
"field20" : "string"
}
I have about 20 fields and on serializing like below
FormRequestJsonData formDataObject = new GsonBuilder().create().fromJson(
content, FormRequestJsonData.class);
I will need to some dynamic processing for each field in formDataObject with xssapi validation.
So need to get each key and need to write xssapi.filter code.
Is there a possibility for the getting all the field names as keyset so that need not hardcode the formDataObject keys
currently doing
if("field1"){
xssapi.filterhtml(formDataObject.getField1());
}
if("field2"){
xssapi.filterhtml(formDataObject.getField2());
}
Regards,
Srinivas
Solved! Go to Solution.
Views
Replies
Total Likes
There is a way to do that,
you can map String response to map. this will give you key and value in map format
private List<Map<String, Object>> fragment = new ArrayList<>();
Hello,
Any inputs from anyone on this
Thanks
There is a way to do that,
you can map String response to map. this will give you key and value in map format
private List<Map<String, Object>> fragment = new ArrayList<>();
Views
Likes
Replies