|
|
|
Re: Ecore Attributes [message #422266 is a reply to message #422265] |
Wed, 27 August 2008 19:06 |
Ed Merks Messages: 33236 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------030101070807030302090607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Gary,
XMLResource.OPTION_KEEP_DEFAULT_CONTENT. You'd set it as a save option
in your resource factory. Newsgroup search is quite handy for finding
previous answers to questions like this:
< http://www.eclipse.org/newsportal/thread.php?group=eclipse.t ools.emf>
http://www.eclipse.org/newsportal/thread.php?group=eclipse.t ools.emf
Gary Leask wrote:
> Ed,
>
> Sorry but,
>
> Where is OPTION_KEEP_DEFAULT_CONTENT defined and where do I put it in
> my code to alter the default behavior.
>
> Gary
>
> Ed Merks wrote:
>> Gary,
>>
>> Comments below.
>>
>> Gary Leask wrote:
>>> I have defined an Attribute in the Ecore and given it a Default
>>> Value Literal. When I create a document that uses the attribute the
>>> value is not serialized.
>> Yes, when eIsSet is false for a feature it won't be serialized. But
>> you can use this option to alter that behavior:
>>
>> OPTION_KEEP_DEFAULT_CONTENT
>>
>>
>>> How can I define an unchangeable default value in the model
>> I'm not sure what you mean by unchangeable. If you serialize it, I
>> assume you expect it to be read in again and hence for it to be
>> changeable...
>>> and have it serialized to the document.
>>>
>>> Thanks Gary
--------------030101070807030302090607
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Gary,<br>
<br>
XMLResource.OPTION_KEEP_DEFAULT_CONTENT. You'd set it as a save option
in your resource factory. Newsgroup search is quite handy for finding
previous answers to questions like this:<a
href=" http://www.eclipse.org/newsportal/thread.php?group=eclipse.t ools.emf"><br>
</a>
<blockquote><a
href=" http://www.eclipse.org/newsportal/thread.php?group=eclipse.t ools.emf"> http://www.eclipse.org/newsportal/thread.php?group=eclipse.t ools.emf</a><br>
</blockquote>
<br>
Gary Leask wrote:
<blockquote cite="mid:g9482t$sjh$1@build.eclipse.org" type="cite">Ed,
<br>
<br>
Sorry but,
<br>
<br>
Where is OPTION_KEEP_DEFAULT_CONTENT defined and where do I put it in
my code to alter the default behavior.
<br>
<br>
Gary
<br>
<br>
Ed Merks wrote:
<br>
<blockquote type="cite">Gary,
<br>
<br>
Comments below.
<br>
<br>
Gary Leask wrote:
<br>
<blockquote type="cite">I have defined an Attribute in the Ecore
and given it a Default Value Literal. When I create a document that
uses the attribute the value is not serialized. </blockquote>
Yes, when eIsSet is false for a feature it won't be serialized. But you
can use this option to alter that behavior:
<br>
<br>
OPTION_KEEP_DEFAULT_CONTENT
<br>
<br>
<br>
<blockquote type="cite">How can I define an unchangeable default
value in the model
<br>
</blockquote>
I'm not sure what you mean by unchangeable. If you serialize it, I
assume you expect it to be read in again and hence for it to be
changeable...
<br>
<blockquote type="cite">and have it serialized to the document.
<br>
<br>
Thanks Gary
<br>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>
--------------030101070807030302090607--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02454 seconds