| <%@ jet package="org.eclipse.emf.codegen.ecore.templates.model" imports="org.eclipse.emf.codegen.ecore.genmodel.*" class="XMLProcessorClass" version="$Id: XMLProcessorClass.javajet,v 1.1 2010/01/02 08:57:28 atoulme Exp $" %> |
| <% |
| /** |
| * <copyright> |
| * |
| * Copyright (c) 2005-2006 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM - Initial API and implementation |
| * |
| * </copyright> |
| */ |
| %> |
| <%GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel();%> |
| <%@ include file="../Header.javajetinc"%> |
| package <%=genPackage.getUtilitiesPackageName()%>; |
| |
| <%genModel.getImportedName("java.util.Map");%> |
| <%genModel.markImportLocation(stringBuffer);%> |
| |
| /** |
| * This class contains helper methods to serialize and deserialize XML documents |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class <%=genPackage.getXMLProcessorClassName()%> extends <%=genPackage.getImportedXMLProcessorBaseClassName()%> |
| { |
| <%if (genModel.hasCopyrightField()) {%> |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%> |
| |
| <%}%> |
| |
| /** |
| * Public constructor to instantiate the helper. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public <%=genPackage.getXMLProcessorClassName()%>() |
| { |
| <%if (genPackage.hasExtendedMetaData() && !genPackage.hasTargetNamespace()) {%> |
| super(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.EPackageRegistryImpl")%>(<%=genModel.getImportedName("org.eclipse.emf.ecore.EPackage")%>.Registry.INSTANCE)); |
| extendedMetaData.putPackage(null, <%=genPackage.getImportedPackageInterfaceName()%>.eINSTANCE); |
| <%} else {%> |
| super((<%=genModel.getImportedName("org.eclipse.emf.ecore.EPackage")%>.Registry.INSTANCE)); |
| <%=genPackage.getImportedPackageInterfaceName()%>.eINSTANCE.eClass(); |
| <%}%> |
| } |
| |
| /** |
| * Register for "*" and "xml" file extensions the <%=genPackage.getResourceFactoryClassName()%> factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| <%if (genModel.useClassOverrideAnnotation()) {%> |
| @Override |
| <%}%> |
| protected Map<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%><<%=genModel.getImportedName("java.lang.String")%>, <%=genModel.getImportedName("org.eclipse.emf.ecore.resource.Resource")%>.Factory><%}%> getRegistrations() |
| { |
| if (registrations == null) |
| { |
| super.getRegistrations(); |
| registrations.put(XML_EXTENSION, new <%=genPackage.getResourceFactoryClassName()%>()); |
| registrations.put(STAR_EXTENSION, new <%=genPackage.getResourceFactoryClassName()%>()); |
| } |
| return registrations; |
| } |
| |
| } //<%=genPackage.getXMLProcessorClassName()%> |
| <%genModel.emitSortedImports();%> |