1 package org.catacomb.act; 2 3 4 public class SuperCallConstructor { 5 6 String argtype; 7 String body = null; 8 9 public SuperCallConstructor(String atyp) { 10 argtype = atyp; 11 } 12 13 public SuperCallConstructor(String atyp, String bdy) { 14 argtype = atyp; 15 body = bdy; 16 } 17 18 public String toJavaSource(String cnm) { 19 StringBuffer sb = new StringBuffer(); 20 if (argtype != null) { 21 sb.append(" public " + cnm + "(" + argtype + " v) {\n"); 22 sb.append(" super(v);\n"); 23 } else { 24 sb.append(" public " + cnm + "() {\n"); 25 sb.append(" super();\n"); 26 } 27 if (body != null) { 28 sb.append(" " + body + ";\n"); 29 } 30 sb.append(" }\n"); 31 return sb.toString(); 32 } 33 34 35 }