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;
10 protected static String nl;
19 public final String NL = nl ==
null ? (System.getProperties().getProperty(
"line.separator")) : nl;
20 protected final String TEXT_1 = NL +
"function ";
21 protected final String TEXT_2 =
" returns ";
22 protected final String TEXT_3 =
" ";
23 protected final String TEXT_4 = NL +
"\t( ) forward.";
24 protected final String TEXT_5 = NL;
29 public String generate(ITemplateArgs argument)
throws TemplateGenerationException
31 final StringBuffer stringBuffer =
new StringBuffer();
33 String functionName = argument.get(
"functionname");
34 boolean isPrivate = argument.get(
"private").equalsIgnoreCase(
"true");
35 String returnType = argument.get(
"returntype");
37 stringBuffer.append(TEXT_1);
38 stringBuffer.append( functionName );
39 stringBuffer.append(TEXT_2);
40 stringBuffer.append( returnType );
41 stringBuffer.append(TEXT_3);
42 stringBuffer.append( (isPrivate ?
"private" :
"") );
43 stringBuffer.append(TEXT_4);
44 stringBuffer.append(TEXT_5);
45 return stringBuffer.toString();