I'm implementing KvmSerializable for communication with webservice with complex types.
I have a List property. But I'm indicating the type List.class and that list is not getting there in the webservice.
What am I doing wrong?
public class CadastrosImpGarIn implements KvmSerializable {
public int codCli;
public int codEmp;
public int codFil;
public int codMot;
public String datCol;
public String flowInstanceID;
public String flowName;
public String numDoc;
public List<CadastrosImpGarInTabBat> tabBat;
@Override
public Object getProperty(int index) {
switch (index) {
case 0:
return codCli;
case 1:
return codEmp;
case 2:
return codFil;
case 3:
return codMot;
case 4:
return datCol;
case 5:
return flowInstanceID;
case 6:
return flowName;
case 7:
return numDoc;
case 8:
return tabBat;
default:
return null;
}
}
@Override
public int getPropertyCount() {
return 8;
}
@SuppressWarnings("rawtypes")
@Override
public void getPropertyInfo(int index, Hashtable hash, PropertyInfo info) {
switch (index) {
case 0:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "codCli";
break;
case 1:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "codEmp";
break;
case 2:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "codFil";
break;
case 3:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "codMot";
break;
case 4:
info.type = PropertyInfo.STRING_CLASS;
info.name = "datCol";
break;
case 5:
info.type = PropertyInfo.STRING_CLASS;
info.name = "flowInstanceID";
break;
case 6:
info.type = PropertyInfo.STRING_CLASS;
info.name = "flowName";
break;
case 7:
info.type = PropertyInfo.STRING_CLASS;
info.name = "numDoc";
break;
case 8:
info.type = List.class;
info.name = "tabBat";
break;
default:
break;
}
}
@SuppressWarnings("unchecked")
@Override
public void setProperty(int index, Object value) {
switch (index) {
case 0:
codCli = Integer.parseInt(value.toString());
break;
case 1:
codEmp = Integer.parseInt(value.toString());
break;
case 2:
codFil = Integer.parseInt(value.toString());
break;
case 3:
codMot = Integer.parseInt(value.toString());
break;
case 4:
datCol = value.toString();
break;
case 5:
flowInstanceID = value.toString();
break;
case 6:
flowName = value.toString();
break;
case 7:
numDoc = value.toString();
break;
//TODO List?
case 8:
tabBat = (List<CadastrosImpGarInTabBat>) value;
break;
default:
break;
}
}
}