}
}
public TableConfig parseFromXML(InputStream inputStream) throws SAXException, IOException {
NodeData nodeData = new XMLHelper().parseXML(inputStream);
TableConfig config = new TableConfig();
// table
BeanHelper.copyProperties(config, nodeData.attributes,true);
for(NodeData child : nodeData.childs) {
// table/operation
if("operation".equals(child.nodeName)) {
OperationConfig target = new OperationConfig();
BeanHelper.copyProperties(target, child.attributes,true);
for(NodeData opChild : child.childs) {
// table/operation/extraparams
if("extraparams".equals(opChild.nodeName)) {
// table/operation/extraparams/param
for(NodeData paramNode : opChild.childs) {
ParamConfig mp = new ParamConfig();
BeanHelper.copyProperties(mp, paramNode.attributes,true);
target.extraparams.add(mp);
}
}else {
BeanHelper.setProperty(target, opChild.nodeName, getNodeValue(opChild));
}
}
config.operations.add(target);
}
// table/column
if("column".equals(child.nodeName)) {
ColumnConfig target = new ColumnConfig();
BeanHelper.copyProperties(target, child.attributes,true);
config.columns.add(target);
}
// table/sql
if("sql".equals(child.nodeName)) {
SqlConfig target = new SqlConfig();
BeanHelper.copyProperties(target, child.attributes,true);
target.setSql(getNodeValue(child));
config.addSqlConfig(target);
}
// table/resultmap
if("resultmap".equals(child.nodeName)) {
ResultMapConfig target = new ResultMapConfig();
BeanHelper.copyProperties(target, child.attributes,true);