2,修改Operation的option属性的类型再次改为Map<String, Object> 3,完成operation的抽象定义 4,梳理operation和AP的关系 5,其他hechu
parent
42612fdfef
commit
a0ddf99418
@ -1,27 +0,0 @@
|
||||
package core.operation;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface Executable {
|
||||
default void execute(String options){
|
||||
|
||||
}
|
||||
|
||||
default void execute(Map<String, String> options) throws Exception {
|
||||
checkSelf();
|
||||
beforeRun(options);
|
||||
run(options);
|
||||
afterRun(options);
|
||||
}
|
||||
|
||||
void checkSelf ()throws Exception;
|
||||
|
||||
void beforeRun(Map<String, String> options);
|
||||
|
||||
void run(Map<String, String> options);
|
||||
|
||||
|
||||
|
||||
void afterRun(Map<String, String> options);
|
||||
}
|
@ -1,13 +1,7 @@
|
||||
package core.operation;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
public class UploadFileOperation extends Operation {
|
||||
Map<String, Object> options;
|
||||
@Override
|
||||
public void run(Map<String, String> options) {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,19 @@
|
||||
package core.operation.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public interface util {
|
||||
static void checkOptions(File jsonFile, Map<String, String> options){
|
||||
|
||||
static String stringOptionsFormat(String options){
|
||||
return options.replaceAll(" {2,}", " ") ;
|
||||
}
|
||||
static Map<String, Object> string2MapOptions(String sOptions){
|
||||
sOptions = stringOptionsFormat(sOptions);
|
||||
Map<String, Object> options = new HashMap<>();
|
||||
String[] sOpts = sOptions.split(" ");
|
||||
for(int i=0;i<sOpts.length;i++){
|
||||
options.put(sOpts[i],sOpts[++i]);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
package core.process;
|
||||
|
||||
public class APSet {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package core.user;
|
||||
|
||||
public class Administrator {
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package gdms;
|
||||
|
||||
public interface Mode {
|
||||
public static int strict = 1;
|
||||
public static int debug = 1;
|
||||
}
|
Loading…
Reference in new issue