parent
6d6b4121d5
commit
4d62390572
Binary file not shown.
Binary file not shown.
@ -1,19 +1,21 @@
|
||||
package core.operation;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface Executable {
|
||||
default void execute(String options) throws Exception {
|
||||
default void execute(Map<String, Object> options) throws Exception {
|
||||
checkSelf();
|
||||
beforeDo(options);
|
||||
Do(options);
|
||||
afterDo(options);
|
||||
beforeRun(options);
|
||||
run(options);
|
||||
afterRun(options);
|
||||
}
|
||||
|
||||
void checkSelf ()throws Exception;
|
||||
|
||||
void beforeDo(String options);
|
||||
void beforeRun(Map<String, Object> options);
|
||||
|
||||
void Do(String options);
|
||||
void run(Map<String, Object> options);
|
||||
|
||||
void afterDo(String options);
|
||||
void afterRun(Map<String, Object> options);
|
||||
}
|
||||
|
@ -1,8 +1,13 @@
|
||||
package core.operation;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
public class UploadFileOperation extends Operation {
|
||||
Map<String, Object> options;
|
||||
@Override
|
||||
public void Do(String options) {
|
||||
public void run(Map<String, Object> options) {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"java.lang.String": "activity",
|
||||
"lava.io.File": "file"
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package core.operation.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
public interface util {
|
||||
static void checkOptions(File jsonFile, Map<String, Object> options){
|
||||
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"fileName":"process"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package core.user;
|
||||
|
||||
public class Student extends User {
|
||||
import java.io.File;
|
||||
|
||||
public class Student extends User {
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package core.user;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class Teacher extends User {
|
||||
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"fileName":"student"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"fileName":"studentProcess"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"fileName":"teacher"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"fileName":"teacherProcess"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package core.utils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface ConfigurationFileManagement {
|
||||
static File getConfigurationFile(String className){
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package core.utils;
|
||||
|
||||
public interface GetObjectByName {
|
||||
String userClassPath = "core.user";
|
||||
String operationClassPath = "core.operation";
|
||||
static Object getUserByName(String name) throws Exception {
|
||||
return Class.forName(userClassPath+"."+name).getDeclaredConstructor().newInstance();
|
||||
}
|
||||
static Object getOperationByName(String name) throws Exception{
|
||||
return Class.forName(operationClassPath+"."+name).getDeclaredConstructor().newInstance();
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package interfaces;
|
||||
|
||||
public interface AvailableByName {
|
||||
//todo:@mustBeOverride
|
||||
static String getClassPath(){
|
||||
return null;
|
||||
}
|
||||
static Object getObjectByName(String name) throws Exception {
|
||||
return Class.forName(getClassPath()+"."+name).getDeclaredConstructor().newInstance();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue