当前位置: 首页>>代码示例>>Java>>正文


Java XMLParserPoolImpl类代码示例

本文整理汇总了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;		
}
 
开发者ID:MenthorTools,项目名称:menthor-xcore,代码行数:16,代码来源:TransformerUtil.java

示例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;
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:22,代码来源:ModelUtil.java

示例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;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:16,代码来源:Util.java


注:本文中的org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。