1 package org.eclipse.emf.codegen.ecore.templates.model; 2 3 import org.eclipse.emf.codegen.ecore.genmodel.*; 4 5 public class ResourceClass 6 { 7 protected static String nl; 8 public static synchronized ResourceClass create(String lineSeparator) 9 { 10 nl = lineSeparator; 11 ResourceClass result = new ResourceClass(); 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 = "/**" + NL + " * <copyright>" + NL + " * </copyright>" + NL + " *" + NL + " * "; 19 protected final String TEXT_3 = "Id"; 20 protected final String TEXT_4 = NL + " */" + NL + "package "; 21 protected final String TEXT_5 = ";" + NL; 22 protected final String TEXT_6 = NL + NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * The <b>Resource </b> associated with the package." + NL + " * <!-- end-user-doc -->" + NL + " * @see "; 23 protected final String TEXT_7 = NL + " * @generated" + NL + " */" + NL + "public class "; 24 protected final String TEXT_8 = " extends "; 25 protected final String TEXT_9 = NL + "{"; 26 protected final String TEXT_10 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; 27 protected final String TEXT_11 = " copyright = \""; 28 protected final String TEXT_12 = "\";"; 29 protected final String TEXT_13 = NL; 30 protected final String TEXT_14 = NL + "\t/**" + NL + "\t * Creates an instance of the resource." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param uri the URI of the new resource." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; 31 protected final String TEXT_15 = "(URI uri)" + NL + "\t{" + NL + "\t\tsuper(uri);"; 32 protected final String TEXT_16 = NL + "\t}" + NL + "" + NL + "} //"; 33 protected final String TEXT_17 = NL; 34 35 public String generate(Object argument) 36 { 37 StringBuffer stringBuffer = new StringBuffer (); 38 39 53 54 GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel(); 55 stringBuffer.append(TEXT_1); 56 stringBuffer.append(TEXT_2); 57 stringBuffer.append("$"); 58 stringBuffer.append(TEXT_3); 59 stringBuffer.append("$"); 60 stringBuffer.append(TEXT_4); 61 stringBuffer.append(genPackage.getUtilitiesPackageName()); 62 stringBuffer.append(TEXT_5); 63 genModel.getImportedName("org.eclipse.emf.common.util.URI"); 64 genModel.markImportLocation(stringBuffer); 65 stringBuffer.append(TEXT_6); 66 stringBuffer.append(genPackage.getQualifiedResourceFactoryClassName()); 67 stringBuffer.append(TEXT_7); 68 stringBuffer.append(genPackage.getResourceClassName()); 69 stringBuffer.append(TEXT_8); 70 stringBuffer.append(genPackage.getImportedResourceBaseClassName()); 71 stringBuffer.append(TEXT_9); 72 if (genModel.getCopyrightText() != null) { 73 stringBuffer.append(TEXT_10); 74 stringBuffer.append(genModel.getImportedName("java.lang.String")); 75 stringBuffer.append(TEXT_11); 76 stringBuffer.append(genModel.getCopyrightText()); 77 stringBuffer.append(TEXT_12); 78 stringBuffer.append(genModel.getNonNLS()); 79 stringBuffer.append(TEXT_13); 80 } 81 stringBuffer.append(TEXT_14); 82 stringBuffer.append(genPackage.getResourceClassName()); 83 stringBuffer.append(TEXT_15); 84 if (genPackage.getResource() == GenResourceKind.XML_LITERAL) { 85 } 86 stringBuffer.append(TEXT_16); 87 stringBuffer.append(genPackage.getResourceClassName()); 88 genModel.emitSortedImports(); 89 stringBuffer.append(TEXT_17); 90 return stringBuffer.toString(); 91 } 92 } 93 | Popular Tags |