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")
@Expose
private String field1;
@SerializedName("field2")
@Expose
private String field2;
....
@SerializedName("field20")
@Expose
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