| /** |
| * <copyright> |
| * |
| * Copyright (c) 2010 E.D.Willink 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: |
| * E.D.Willink - Initial API and implementation |
| * |
| * </copyright> |
| * |
| * $Id: PivotResourceFactoryImpl.java,v 1.2 2011/01/24 20:42:33 ewillink Exp $ |
| */ |
| package org.eclipse.ocl.examples.pivot.utilities; |
| |
| import org.eclipse.emf.common.util.URI; |
| import org.eclipse.emf.ecore.resource.Resource; |
| import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; |
| import org.eclipse.emf.ecore.xmi.XMLResource; |
| import org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl; |
| |
| /** |
| * The <b>Resource Factory</b> associated with the package. |
| * @see org.eclipse.ocl.examples.pivot.utilities.PivotResourceImpl |
| */ |
| public class PivotResourceFactoryImpl extends ResourceFactoryImpl implements PivotResource.Factory |
| { |
| /** |
| * Creates an instance of the resource factory. |
| */ |
| public PivotResourceFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * Creates an instance of the resource. |
| */ |
| @Override |
| public Resource createResource(URI uri) { |
| PivotResource result = new PivotResourceImpl(uri); |
| result.setEncoding(PivotResource.DEFAULT_ENCODING); |
| result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); |
| result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, 80); |
| result.getDefaultSaveOptions().put(XMLResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware()); |
| result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); |
| return result; |
| } |
| } |