1 30 package com.genimen.djeneric.tools.strongtyper; 31 32 public class ParentInterfaceGenerator extends Generator 33 { 34 public ParentInterfaceGenerator() 35 { 36 } 37 38 public String getPackageName() 39 { 40 return getItfPackageName(); 41 } 42 43 public String getClassName() 44 { 45 return getParentInterfaceClassName() + (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 interface " + getClassName() + "\n"); 56 code.append("{\n"); 57 58 code.append(" public boolean isMarkedForDestroy();\n" + " public void destroy() throws " 59 + getExceptionClassName() + ";\n" + " public void checkRequired() throws " + getExceptionClassName() 60 + ";\n" + " public void reloadFromStore() throws " + getExceptionClassName() + ";\n" 61 + " public boolean isNew();\n" + " public boolean isPersisted();\n" 62 + " public void makeTransient() throws " + getExceptionClassName() + ";\n" 63 + " public boolean isTransient();\n" + " public boolean isEmpty();\n" 64 + " public boolean isModified();\n"); 65 66 code.append(StrongTyper.getRegenerationTags(0)); 67 code.append("}\n"); 68 return code.toString(); 69 } 70 71 } | Popular Tags |