1 30 package com.genimen.djeneric.tools.strongtyper; 31 32 public class MultipleFoundExceptionGenerator extends Generator 33 { 34 public MultipleFoundExceptionGenerator() 35 { 36 } 37 38 public String getPackageName() 39 { 40 return getItfPackageName(); 41 } 42 43 public String getClassName() 44 { 45 return getMultipleFoundExceptionClassName() + (isAbstract() ? getGeneratedSuffix() : ""); 46 } 47 48 public String getCode() throws Exception 49 { 50 StringBuffer code = new StringBuffer (5000); 51 if (getPackageName().trim().length() > 0) code.append("package " + getPackageName() + ";\n\n"); 52 53 code.append(StrongTyper.getRegenerationTags(1)); 54 55 code.append("public class " + getClassName() + " extends " + getExceptionClassName() + "{\n" + " public " 56 + getClassName() + "()\n" + " {\n" + " super();\n" + " }\n" + "\n" + " public " + getClassName() 57 + "(String message)\n" + " {\n" + " super(message, MULTIPLE_OBJECTS_FOUND);\n" + " }\n" + "\n"); 58 code.append(StrongTyper.getRegenerationTags(0)); 59 code.append("}\n"); 60 return code.toString(); 61 } 62 } | Popular Tags |