KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > codegen > ecore > templates > model > PluginProperties


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 JavaDoc nl;
8   public static synchronized PluginProperties create(String JavaDoc lineSeparator)
9   {
10     nl = lineSeparator;
11     PluginProperties result = new PluginProperties();
12     nl = null;
13     return result;
14   }
15
16   protected final String JavaDoc NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17   protected final String JavaDoc TEXT_1 = "";
18   protected final String JavaDoc TEXT_2 = "# <copyright>" + NL + "# </copyright>" + NL + "#" + NL + "# ";
19   protected final String JavaDoc TEXT_3 = "Id";
20   protected final String JavaDoc 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 JavaDoc TEXT_5 = " Model" + NL + "providerName = www.example.org" + NL;
22   protected final String JavaDoc TEXT_6 = NL;
23
24   public String JavaDoc generate(Object JavaDoc argument)
25   {
26     StringBuffer JavaDoc stringBuffer = new StringBuffer JavaDoc();
27     
28 /**
29  * <copyright>
30  *
31  * Copyright (c) 2002-2004 IBM Corporation and others.
32  * All rights reserved. This program and the accompanying materials
33  * are made available under the terms of the Eclipse Public License v1.0
34  * which accompanies this distribution, and is available at
35  * http://www.eclipse.org/legal/epl-v10.html
36  *
37  * Contributors:
38  * IBM - Initial API and implementation
39  *
40  * </copyright>
41  */

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