Search in sources :

Example 6 with XMIResource

use of org.eclipse.emf.ecore.xmi.XMIResource in project InformationSystem by ObeoNetwork.

the class ViewResourceFactoryImpl method createResource.

/**
 * Creates an instance of the resource.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
@Override
public Resource createResource(URI uri) {
    XMIResource result = new ViewResourceImpl(uri);
    Map<Object, Object> saveOptions = result.getDefaultSaveOptions();
    saveOptions.put(XMLResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware());
    saveOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
    saveOptions.put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE, lookupTable);
    Map<Object, Object> loadOptions = result.getDefaultLoadOptions();
    loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
    loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, parserPool);
    loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, nameToFeatureMap);
    return result;
}
Also used : URIHandlerImpl(org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl) XMIResource(org.eclipse.emf.ecore.xmi.XMIResource)

Example 7 with XMIResource

use of org.eclipse.emf.ecore.xmi.XMIResource in project InformationSystem by ObeoNetwork.

the class CinematicResourceFactoryImpl method createResource.

/**
 * Creates an instance of the resource.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
@Override
public Resource createResource(URI uri) {
    XMIResource result = new CinematicResourceImpl(uri);
    Map<Object, Object> saveOptions = result.getDefaultSaveOptions();
    saveOptions.put(XMLResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware());
    saveOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
    saveOptions.put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE, lookupTable);
    Map<Object, Object> loadOptions = result.getDefaultLoadOptions();
    loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
    loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, parserPool);
    loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, nameToFeatureMap);
    return result;
}
Also used : URIHandlerImpl(org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl) XMIResource(org.eclipse.emf.ecore.xmi.XMIResource)

Example 8 with XMIResource

use of org.eclipse.emf.ecore.xmi.XMIResource in project InformationSystem by ObeoNetwork.

the class TypesLibraryResourceFactoryImpl method createResource.

@Override
public Resource createResource(URI uri) {
    XMIResource resource = new TypesLibraryResourceImpl(uri);
    Map<Object, Object> saveOptions = resource.getDefaultSaveOptions();
    saveOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
    saveOptions.put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE, lookupTable);
    Map<Object, Object> loadOptions = resource.getDefaultLoadOptions();
    loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
    loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, parserPool);
    loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, nameToFeatureMap);
    return resource;
}
Also used : XMIResource(org.eclipse.emf.ecore.xmi.XMIResource)

Example 9 with XMIResource

use of org.eclipse.emf.ecore.xmi.XMIResource in project InformationSystem by ObeoNetwork.

the class FlowResourceFactoryImpl method createResource.

/**
 * Creates an instance of the resource.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
@Override
public Resource createResource(URI uri) {
    XMIResource result = new FlowResourceImpl(uri);
    Map<Object, Object> saveOptions = result.getDefaultSaveOptions();
    saveOptions.put(XMLResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware());
    saveOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
    saveOptions.put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE, lookupTable);
    Map<Object, Object> loadOptions = result.getDefaultLoadOptions();
    loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
    loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, parserPool);
    loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, nameToFeatureMap);
    return result;
}
Also used : URIHandlerImpl(org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl) XMIResource(org.eclipse.emf.ecore.xmi.XMIResource)

Example 10 with XMIResource

use of org.eclipse.emf.ecore.xmi.XMIResource in project InformationSystem by ObeoNetwork.

the class StateMachineResourceFactoryImpl method createResource.

/**
 * Creates an instance of the resource.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public Resource createResource(URI uri) {
    XMIResource result = new StateMachineResourceImpl(uri);
    Map<Object, Object> saveOptions = result.getDefaultSaveOptions();
    saveOptions.put(XMLResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware());
    saveOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
    saveOptions.put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE, lookupTable);
    Map<Object, Object> loadOptions = result.getDefaultLoadOptions();
    loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
    loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
    loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, parserPool);
    loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, nameToFeatureMap);
    return result;
}
Also used : URIHandlerImpl(org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl) XMIResource(org.eclipse.emf.ecore.xmi.XMIResource)

Aggregations

XMIResource (org.eclipse.emf.ecore.xmi.XMIResource)15 URIHandlerImpl (org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl)5 Resource (org.eclipse.emf.ecore.resource.Resource)4 XMIResourceImpl (org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 URI (org.eclipse.emf.common.util.URI)2 EObject (org.eclipse.emf.ecore.EObject)2 TModule (org.eclipse.n4js.ts.types.TModule)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 HashMap (java.util.HashMap)1 List (java.util.List)1 BasicDiagnostic (org.eclipse.emf.common.util.BasicDiagnostic)1 EList (org.eclipse.emf.common.util.EList)1 Comparison (org.eclipse.emf.compare.Comparison)1 Match (org.eclipse.emf.compare.Match)1 EReference (org.eclipse.emf.ecore.EReference)1 XMLResource (org.eclipse.emf.ecore.xmi.XMLResource)1 Main (org.eclipse.xtext.linking.langATestLanguage.Main)1