| 1 |
<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model" imports="org.eclipse.emf.codegen.ecore.genmodel.*" class="XMLProcessorClass"%> |
| 2 |
<% |
| 3 |
/** |
| 4 |
* Copyright (c) 2005-2006 IBM Corporation and others. |
| 5 |
* All rights reserved. This program and the accompanying materials |
| 6 |
* are made available under the terms of the Eclipse Public License v2.0 |
| 7 |
* which accompanies this distribution, and is available at |
| 8 |
* http://www.eclipse.org/legal/epl-v20.html |
| 9 |
* |
| 10 |
* Contributors: |
| 11 |
* IBM - Initial API and implementation |
| 12 |
*/ |
| 13 |
%> |
| 14 |
<%GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel();%> |
| 15 |
<%final boolean isJDK50 = genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50;%> |
| 16 |
<%@ include file="../Header.javajetinc"%> |
| 17 |
package <%=genPackage.getUtilitiesPackageName()%>; |
| 18 |
|
| 19 |
<%genModel.getImportedName("java.util.Map");%> |
| 20 |
<%genModel.markImportLocation(stringBuffer);%> |
| 21 |
|
| 22 |
/** |
| 23 |
* This class contains helper methods to serialize and deserialize XML documents |
| 24 |
* <!-- begin-user-doc --> |
| 25 |
* <!-- end-user-doc --> |
| 26 |
<%if (genPackage.hasAPITags()) {%> |
| 27 |
* <%=genPackage.getAPITags(genModel.getIndentation(stringBuffer))%> |
| 28 |
<%}%> |
| 29 |
* @generated |
| 30 |
*/ |
| 31 |
<%if (isJDK50 && genPackage.hasAPIDeprecatedTag()) {%> |
| 32 |
@Deprecated |
| 33 |
<%}%> |
| 34 |
public class <%=genPackage.getXMLProcessorClassName()%> extends <%=genPackage.getImportedXMLProcessorBaseClassName()%> |
| 35 |
{ |
| 36 |
<%if (genModel.hasCopyrightField()) {%> |
| 37 |
/** |
| 38 |
* <!-- begin-user-doc --> |
| 39 |
* <!-- end-user-doc --> |
| 40 |
* @generated |
| 41 |
*/ |
| 42 |
public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%> |
| 43 |
|
| 44 |
<%}%> |
| 45 |
|
| 46 |
/** |
| 47 |
* Public constructor to instantiate the helper. |
| 48 |
* <!-- begin-user-doc --> |
| 49 |
* <!-- end-user-doc --> |
| 50 |
* @generated |
| 51 |
*/ |
| 52 |
public <%=genPackage.getXMLProcessorClassName()%>() |
| 53 |
{ |
| 54 |
<%if (genPackage.hasExtendedMetaData() && !genPackage.hasTargetNamespace()) {%> |
| 55 |
super(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.EPackageRegistryImpl")%>(<%=genModel.getImportedName("org.eclipse.emf.ecore.EPackage")%>.Registry.INSTANCE)); |
| 56 |
extendedMetaData.putPackage(null, <%=genPackage.getImportedPackageInterfaceName()%>.eINSTANCE); |
| 57 |
<%} else {%> |
| 58 |
super((<%=genModel.getImportedName("org.eclipse.emf.ecore.EPackage")%>.Registry.INSTANCE)); |
| 59 |
<%=genPackage.getImportedPackageInterfaceName()%>.eINSTANCE.eClass(); |
| 60 |
<%}%> |
| 61 |
} |
| 62 |
|
| 63 |
/** |
| 64 |
* Register for "*" and "xml" file extensions the <%=genPackage.getResourceFactoryClassName()%> factory. |
| 65 |
* <!-- begin-user-doc --> |
| 66 |
* <!-- end-user-doc --> |
| 67 |
* @generated |
| 68 |
*/ |
| 69 |
<%if (genModel.useClassOverrideAnnotation()) {%> |
| 70 |
@Override |
| 71 |
<%}%> |
| 72 |
protected Map<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%><<%=genModel.getImportedName("java.lang.String")%>, <%=genModel.getImportedName("org.eclipse.emf.ecore.resource.Resource")%>.Factory><%}%> getRegistrations() |
| 73 |
{ |
| 74 |
if (registrations == null) |
| 75 |
{ |
| 76 |
super.getRegistrations(); |
| 77 |
registrations.put(XML_EXTENSION, new <%=genPackage.getResourceFactoryClassName()%>()); |
| 78 |
registrations.put(STAR_EXTENSION, new <%=genPackage.getResourceFactoryClassName()%>()); |
| 79 |
} |
| 80 |
return registrations; |
| 81 |
} |
| 82 |
|
| 83 |
} //<%=genPackage.getXMLProcessorClassName()%> |
| 84 |
<%genModel.emitSortedImports();%> |