1 package org.eclipse.emf.codegen.ecore.templates.model; 2 3 import org.eclipse.emf.codegen.ecore.genmodel.*; 4 5 public class PluginProperties 6 { 7 protected static String nl; 8 public static synchronized PluginProperties create(String lineSeparator) 9 { 10 nl = lineSeparator; 11 PluginProperties result = new PluginProperties(); 12 nl = null; 13 return result; 14 } 15 16 protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; 17 protected final String TEXT_1 = ""; 18 protected final String TEXT_2 = "# <copyright>" + NL + "# </copyright>" + NL + "#" + NL + "# "; 19 protected final String TEXT_3 = "Id"; 20 protected final String TEXT_4 = NL + NL + "# ====================================================================" + NL + "# To code developer:" + NL + "# Do NOT change the properties between this line and the" + NL + "# \"%%% END OF TRANSLATED PROPERTIES %%%\" line." + NL + "# Make a new property name, append to the end of the file and change" + NL + "# the code to use the new property." + NL + "# ====================================================================" + NL + "" + NL + "# ====================================================================" + NL + "# %%% END OF TRANSLATED PROPERTIES %%%" + NL + "# ====================================================================" + NL + "" + NL + "pluginName = "; 21 protected final String TEXT_5 = " Model" + NL + "providerName = www.example.org" + NL; 22 protected final String TEXT_6 = NL; 23 24 public String generate(Object argument) 25 { 26 StringBuffer stringBuffer = new StringBuffer (); 27 28 42 43 GenModel genModel = (GenModel)argument; 44 stringBuffer.append(TEXT_1); 45 stringBuffer.append(TEXT_2); 46 stringBuffer.append("$"); 47 stringBuffer.append(TEXT_3); 48 stringBuffer.append("$"); 49 stringBuffer.append(TEXT_4); 50 stringBuffer.append(genModel.getModelName()); 51 stringBuffer.append(TEXT_5); 52 stringBuffer.append(TEXT_6); 53 return stringBuffer.toString(); 54 } 55 } 56 | Popular Tags |