/******************************************************************************* * Copyright (c) 2009, 2011 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 Corporation - initial API and implementation *******************************************************************************/ package org.openhealthtools.uml.xdw; import net.ihe.gazelle.xdw.XDWPackage; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EStructuralFeature; 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.XMLSave; /** * * The Resource Factory associated with the package. * * @see org.openhealthtools.mdht.uml.xdw.internal.resource.XDWResourceImpl * @generated */ public class XDWResourceFactoryImpl extends ResourceFactoryImpl implements XDWResource.Factory { /** * Creates an instance of the resource factory. * * * @generated */ public XDWResourceFactoryImpl() { super(); } /** * Creates an instance of the resource. * * * @generated NOT */ @Override public Resource createResource(URI uri) { XDWResource result = new XDWResourceImpl(uri); result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); result.setEncoding(XDWResource.DEFAULT_ENCODING); result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION, new XMLSave.XMLTypeInfo() { public boolean shouldSaveType(EClass objectType, EClassifier featureType, EStructuralFeature feature) { return objectType != featureType && objectType.getEPackage().getNsURI().equals(XDWPackage.eNS_URI); } public boolean shouldSaveType(EClass objectType, EClass featureType, EStructuralFeature feature) { return false; } }); // result.getDefaultSaveOptions().put(XMLResource.OPTION_KEEP_DEFAULT_CONTENT, Boolean.TRUE); // // result.getDefaultLoadOptions().put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE); result.getDefaultLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); //result.getDefaultLoadOptions().put(XMLResource.OPTION_RESOURCE_HANDLER, new XDWResourceHandler()); return result; } } // XDWResourceFactoryImpl