import org.dom4j.Element;


import cn.cecgw.goku.commons.profile.AbstractXMLParseSrv;

public class ConfigProfileMan extends AbstractXMLParseSrv{


private static  List generalTaskList =new ArrayList<>();

public static List getGeneralTaskList() {

return generalTaskList;

}


@Override

protected void readFromXml(Element root) throws Exception {

@SuppressWarnings("unchecked")

List elementList=root.elements("task");

for(Element elt:elementList) {

GeneralTask generalTask=new GeneralTask();

generalTask.setTaskType(elt.element("taskType").getText());

generalTask.setDstTable(elt.element("dstTable").getText());

generalTask.setTaskID(elt.element("taskID").getText());

generalTask.setExecuteClass(elt.element("executeClass").getText());

generalTask.setCron(elt.element("cron").getText());

generalTaskList.add(generalTask);

}

}


@Override

protected Element writeToXml(Object arg0) throws Exception {

// TODO Auto-generated method stub

return null;

}


public static void main(String[] args) {

new ConfigProfileMan().load();

}

}

}

所用jar包

dom4j-1.6.1.jar

goku-common2-5.1.0.jar