package frame.file;
|
|
import java.util.List;
|
|
public abstract class IOProcessor {
|
private List<IOHandler> ioHandlers;
|
|
public IOProcessor() {
|
ioHandlers = new List<IOHandler>();
|
}
|
|
public void execHandlers(UploadResult result, String eventCode) {
|
ISQLContext context = createContext(result);
|
|
foreach (IOHandler handler in ioHandlers) {
|
if (handler.equalEvent(eventCode)) {
|
handler.exec(result, context);
|
}
|
}
|
}
|
|
public void execHandlers(UploadResult result) {
|
ISQLContext context = createContext(result);
|
|
foreach (IOHandler handler in ioHandlers) {
|
result.addMessage("进行数据处理:" + handler.getSQLName());
|
handler.exec(result, context);
|
}
|
}
|
|
public abstract ISQLContext createContext(UploadResult result);
|
|
public void addHandler(IOHandler handler) {
|
ioHandlers.Add(handler);
|
}
|
|
}
|