File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
JavaProjectGenerator/src/de/loskutov/jpg Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,14 @@ String generateMethods(String type) {
7676 "\t \t this.element = (" +type +")element;\n " +
7777 "\t \t " + extend + ".getInstance" + suffix + "().set" + suffix + "(this.element);\n " +
7878 "\t }\n \n " +
79+ "\t public void run" + suffix + "() {\n " +
80+ "\t \t try {\n " +
81+ "\t \t \t this.call" + suffix + "();\n " +
82+ "\t \t } catch (Exception e) {}\n " +
83+ "\t \t " + extend + ".getInstance" + suffix + "().run();\n " +
84+ "\t }\n \n " +
7985 "\t public " +type +" call" + suffix + "() throws Exception {\n " +
86+ "\t \t " + extend + ".getInstance" + suffix + "().run();\n " +
8087 "\t \t return (" +type +")" + extend + ".getInstance" + suffix + "().call" + suffix + "();\n " +
8188 "\t }\n " ;
8289 sb .append (result );
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ String generateCode() {
2626 String generateTypeDefinition (String type ) {
2727 if (useExtend ) {
2828 return "@SuppressWarnings(\" all\" )\n " +
29- "public interface " + name + "<" +type +"> extends " + extend + "<" +type +"> " ;
29+ "public interface " + name + "<" +type +"> extends " + extend + "<" +type +">, Runnable " ;
3030 }
3131 return "@SuppressWarnings(\" all\" )\n " +
3232 "public interface " + name + "<" +type +"> " ;
You can’t perform that action at this time.
0 commit comments