Home » Modeling » EMF » Contents not loading when using FlatEObjectImpl(working on performance improvements)
Contents not loading when using FlatEObjectImpl [message #540046] |
Mon, 14 June 2010 12:55  |
Eclipse User |
|
|
|
Hi EMF world --
I'm doing some performance tuning of my EMF code. When I change my .genmodel to extend FlatEObjectImpl instead of BasicEObjectImpl, the generated code no longer returns children when I call eContents().
I do also have some custom settings in the ResourceFactoryImpl as follows:
loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, m_parserPool);
loadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STY LE, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_LAX_WILDCARD_PROCESSING, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_SKIP_ESCAPE, Boolean.TRUE);
loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
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_XML_NAME_TO_FEATURE_M AP, m_nameToFeatureMap);
loadOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
Am I supposed to do something else to tell the FlatEObjectImpl to load its children?
thanks
Tamar
|
|
|
Re: Contents not loading when using FlatEObjectImpl [message #540051 is a reply to message #540046] |
Mon, 14 June 2010 13:06   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------000100060008020703080503
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Tamar,
It should still be returning the right (same as before) list:
@Override
public EList<EObject> eContents()
{
if (eContents == null)
{
eContents = *EContentsEList.createEContentsEList(this)*;
}
return eContents;
}
It's a "view" on all the containment references...
Tamar Cohen wrote:
> Hi EMF world --
> I'm doing some performance tuning of my EMF code. When I change my
> .genmodel to extend FlatEObjectImpl instead of BasicEObjectImpl, the
> generated code no longer returns children when I call eContents().
>
> I do also have some custom settings in the ResourceFactoryImpl as
> follows:
> loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA,
> extendedMetaData);
> loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL,
> m_parserPool);
> loadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STY
> LE, Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_USE_LEXICAL_HANDLER,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_LAX_WILDCARD_PROCESSING,
> Boolean.TRUE);
> loadOptions.put(XMLResource.OPTION_SKIP_ESCAPE, Boolean.TRUE);
>
> loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE,
> Boolean.TRUE);
>
> 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_XML_NAME_TO_FEATURE_M
> AP, m_nameToFeatureMap);
> loadOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE,
> Boolean.TRUE);
>
> Am I supposed to do something else to tell the FlatEObjectImpl to load
> its children?
>
> thanks
>
> Tamar
--------------000100060008020703080503
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Tamar,<br>
<br>
It should still be returning the right (same as before) list:<small><br>
</small>
<blockquote><small> @Override</small><br>
<small> public EList<EObject> eContents()</small><br>
<small> {</small><br>
<small> if (eContents == null)</small><br>
<small> {</small><br>
<small> eContents = <b>EContentsEList.createEContentsEList(this)</b>;</small ><br>
<small> }</small><br>
<small> return eContents;</small><br>
<small> }</small><br>
</blockquote>
It's a "view" on all the containment references...<br>
<br>
<br>
Tamar Cohen wrote:
<blockquote cite="mid:hv5mtu$ieo$1@build.eclipse.org" type="cite">Hi
EMF world --
<br>
I'm doing some performance tuning of my EMF code. When I change my
..genmodel to extend FlatEObjectImpl instead of BasicEObjectImpl, the
generated code no longer returns children when I call eContents().
<br>
<br>
I do also have some custom settings in the ResourceFactoryImpl as
follows:
<br>
loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA,
extendedMetaData);
<br>
loadOptions.put(XMLResource.OPTION_USE_PARSER_POOL,
m_parserPool);
<br>
loadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STY
LE, Boolean.TRUE);
<br>
loadOptions.put(XMLResource.OPTION_USE_LEXICAL_HANDLER,
Boolean.TRUE);
<br>
loadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING,
Boolean.TRUE);
<br>
loadOptions.put(XMLResource.OPTION_LAX_WILDCARD_PROCESSING,
Boolean.TRUE);
<br>
loadOptions.put(XMLResource.OPTION_SKIP_ESCAPE, Boolean.TRUE);
<br>
<br>
loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE,
Boolean.TRUE);
<br>
<br>
loadOptions.put(XMLResource.OPTION_DEFER_ATTACHMENT,
Boolean.TRUE);
<br>
loadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION,
Boolean.TRUE);
<br>
loadOptions.put(XMLResource.OPTION_USE_DEPRECATED_METHODS,
Boolean.FALSE);
<br>
loadOptions.put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_M
AP, m_nameToFeatureMap);
<br>
loadOptions.put(XMLResource.OPTION_CONFIGURATION_CACHE,
Boolean.TRUE);
<br>
<br>
Am I supposed to do something else to tell the FlatEObjectImpl to load
its children?
<br>
<br>
thanks
<br>
<br>
Tamar
<br>
</blockquote>
</body>
</html>
--------------000100060008020703080503--
|
|
| |
Re: Contents not loading when using FlatEObjectImpl [message #558664 is a reply to message #540046] |
Mon, 13 September 2010 16:23  |
Eclipse User |
|
|
|
aha! aha! Problem solved.
The issue had NOTHING to do with FlatEObjectImpl; the problem was there are many uris for this type of resource. The default one had changed in the Package. Note to others, make sure your nsURI is correct if you see no children loading under a DocumentRoot!
EMF is once again my friend.
Tamar
|
|
|
Goto Forum:
Current Time: Wed Jul 23 21:12:38 EDT 2025
Powered by FUDForum. Page generated in 0.05164 seconds
|