hu.blackbelt.epsilon.runtime.execution.model.emf.DefaultRuntimeXmiResourceImpl Maven / Gradle / Ivy
package hu.blackbelt.epsilon.runtime.execution.model.emf;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl;
import java.util.HashMap;
@Slf4j
public class DefaultRuntimeXmiResourceImpl extends XMIResourceImpl {
protected boolean useXmiIds = super.useUUIDs();
public DefaultRuntimeXmiResourceImpl() {
super();
setOptimizedOptions();
}
public DefaultRuntimeXmiResourceImpl(URI uri) {
super(uri);
log.debug("Load optimized model - " + uri);
setOptimizedOptions();
}
private void setOptimizedOptions() {
super.setIntrinsicIDToEObjectMap(new HashMap());
this.getDefaultLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
this.getDefaultLoadOptions().put(XMIResource.OPTION_USE_DEPRECATED_METHODS, false);
this.getDefaultLoadOptions().put(XMIResource.OPTION_USE_PARSER_POOL, new XMLParserPoolImpl(10000, true));
this.getDefaultLoadOptions().put(XMIResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, new HashMap