1 package com.proalpha.pds.templates.jet.openEdge;
3 import com.openedge.pdt.core.template.ITemplateGenerator;
4 import com.openedge.pdt.core.template.TemplateGenerationException;
5 import com.openedge.pdt.text.template.OETemplateUtil;
6 import com.openedge.pdt.core.template.ITemplateArgs;
8 import com.openedge.core.metadata.Destructor;
12 protected static String nl;
13 public static synchronized pADestructor create(String lineSeparator)
21 public final String NL = nl ==
null ? (System.getProperties().getProperty(
"line.separator")) : nl;
22 protected final String TEXT_1 =
" destructor public ";
23 protected final String TEXT_2 =
" ( ):" + NL +
" /* Description -----------------------------------------------------------*/" + NL +
" /* */" + NL +
" /* */" + NL +
" /* */" + NL +
" /* Notes -----------------------------------------------------------------*/" + NL +
" /* */" + NL +
" /* */" + NL +
" /* */" + NL +
" /* Parameters ------------------------------------------------------------*/" + NL +
" /* */" + NL +
" /* <none> */" + NL +
" /* */" + NL +
" /* Examples --------------------------------------------------------------*/" + NL +
" /* */" + NL +
" /* */" + NL +
" /* */" + NL +
" /*------------------------------------------------------------------------*/" + NL +
"" + NL +
" /* Variables -------------------------------------------------------------*/" + NL +
" /*------------------------------------------------------------------------*/" + NL +
"" + NL +
" /* Buffers ---------------------------------------------------------------*/" + NL +
"" + NL +
" /*------------------------------------------------------------------------*/" + NL +
" /* Processing */" + NL +
" /*------------------------------------------------------------------------*/";
24 protected final String TEXT_3 = NL;
29 public String generate(ITemplateArgs argument)
throws TemplateGenerationException
31 final StringBuffer stringBuffer =
new StringBuffer();
33 Destructor destructor = (Destructor) argument.getObj(
"destructor");
34 String className = (String) argument.get(
"class");
35 if (destructor !=
null) {
36 className = destructor.getName();
39 stringBuffer.append(TEXT_1);
40 stringBuffer.append( className );
41 stringBuffer.append(TEXT_2);
43 if (destructor !=
null) {
44 stringBuffer.append(destructor.getMethodCode());
47 stringBuffer.append(TEXT_3);
49 return stringBuffer.toString();