本文整理汇总了Java中org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl类的典型用法代码示例。如果您正苦于以下问题:Java XMLParserPoolImpl类的具体用法?Java XMLParserPoolImpl怎么用?Java XMLParserPoolImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLParserPoolImpl类属于org.eclipse.emf.ecore.xmi.impl包,在下文中一共展示了XMLParserPoolImpl类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadRefModel
import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl; //导入依赖的package包/类
public static Resource loadRefModel(String refontoumlpath) throws IOException
{
ResourceSet rset = new ResourceSetImpl();
rset.getResourceFactoryRegistry().getExtensionToFactoryMap().put("refontouml",new RefOntoUMLResourceFactoryImpl());
rset.getPackageRegistry().put(RefOntoUML.RefOntoUMLPackage.eNS_URI, RefOntoUML.RefOntoUMLPackage.eINSTANCE);
File file = new File(refontoumlpath);
URI fileURI = URI.createFileURI(file.getAbsolutePath());
Resource resource = rset.createResource(fileURI);
/**Load options that significantly improved the performance of loading EMF Model instances*/
Map<Object,Object> loadOptions = ((XMLResourceImpl)resource).getDefaultLoadOptions();
loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, new XMLParserPoolImpl());
loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
resource.load(loadOptions);
return resource;
}
示例2: getResourceLoadOptions
import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl; //导入依赖的package包/类
/**
* Delivers a map of options for loading resources. Especially {@link XMLResource#OPTION_DEFER_IDREF_RESOLUTION}
* which speeds up loading
* due to our id based resources.
*
* @return map of options for {@link XMIResource} or {@link XMLResource}.
*/
@SuppressWarnings("rawtypes")
public static synchronized Map<Object, Object> getResourceLoadOptions() {
if (resourceLoadOptions == null) {
resourceLoadOptions = new LinkedHashMap<Object, Object>();
resourceLoadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
resourceLoadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
resourceLoadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
resourceLoadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, new XMLParserPoolImpl());
resourceLoadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, new HashMap());
resourceLoadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
resourceLoadOptions.put(XMLResource.OPTION_ENCODING, "UTF-8");
}
return resourceLoadOptions;
}
示例3: getLoadOptions
import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl; //导入依赖的package包/类
protected static Map<Object, Object> getLoadOptions(XMIResourceImpl resource)
{
Map<Object, Object> options = resource.getDefaultLoadOptions();
options.put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
options.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
options.put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
options.put(XMLResource.OPTION_USE_PARSER_POOL, new XMLParserPoolImpl());
options.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP,
new HashMap<Object, Object>());
resource.setIntrinsicIDToEObjectMap(new HashMap<String, EObject>());
return options;
}