日期:2014-05-20  浏览次数:20764 次

求指教!protected类set赋值!
ReportTriggerSetupCmd model = new ReportTriggerSetupCmd();

model.setRName(StringUtils
.getValeByName("cmdname", row, colLabel).asString());
model.setRId(StringUtils
.getValeByName("cmid", row, colLabel).asString());
model.setNeedConfirm(StringUtils
.getValeByName("cmneedConfirm", row, colLabel).asBoolean());
model.setOnNow(StringUtils
.getValeByName("cmonNow", row, colLabel).asBoolean());
model.setSt(StringUtils
.getValeByName("cmst", row, colLabel).asString());
model.setInterval(StringUtils
.getValeByName("cminterval", row, colLabel).asInt());
model.setTimes(StringUtils
.getValeByName("times", row, colLabel).asInt());

List.add(model);

------解决方案--------------------
protected TObject st;
表明你的st类型是TObject的,但是
model.setSt(StringUtils.getValeByName("cmst", row, colLabel).asString());
这句中我感觉你setSt传入的参数是String的,当然与st的类型不符合。
------解决方案--------------------
model.setSt(StringUtils.getValeByName("cmst", row, colLabel).asString());


--> model.setSt((TObject)StringUtils.getValeByName("cmst", row, colLabel).asString());


强制转换一下试试