public static map<string, object> Returnwebserviceparambomap (
Webserviceparambo Webserviceparambo) {
field[] fields = Webserviceparambo.getclass (). Getdeclaredfields ();
hashmap<string, object> data = new hashmap<string, object> ();
for (Field field:fields) {
Variables that can be obtained to the private property
Field.setaccessible (TRUE);
try {
The name obtained is the attribute in the Bo object, Field.get (Webserviceparambo) is the value of the incoming Bo object
Data.put (Field.getname (), Field.get (Webserviceparambo));
} catch (IllegalArgumentException e) {
throw new Gatewaysystemexception (ErrorCode.SYS_ERROR_200000.getErrorCode (), E);
} catch (Illegalaccessexception e) {
throw new Gatewaysystemexception (ErrorCode.SYS_ERROR_200000.getErrorCode (), E);
}
}
return data;
}
This article from "AutoComplete" blog, reproduced please contact the author!
In Java, the value of the Bo object and the passed values are placed in the Map object