|
Re: EMF - Default Valued Feature [message #416703 is a reply to message #416701] |
Wed, 13 February 2008 14:28 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Kamesh,
As discussed in the "Not able to persist Enum types" thread only yesterday
in this group, you can use the XMLResource.OPTION_KEEP_DEFAULT_CONTENT save
option when saving your resource to force it to save default values of
EAttributes.
However, this applies to all EAttributes in your resource, not just
enumerations. There isn't any way (that I know of) to specify that only a
single EAttribute should have its default values saved.
Ordinarily, however, it is not necessary to save defaults. The XSD for your
model encodes the defaults, so any compliant XML reader should be able to
understand the default values in your schema.
HTH,
Christian
Kamesh Sampath wrote:
> Hi ,
>
> Can anyone explain the behavior am facing,
>
> I have an EMF model class as
>
> Type A
>
> - action
> - active (true/false)
> -name
> - id
>
> The features action/active are optional ones referring to an enum with
> default values
>
> When i dont set these features , they are not serialized with default
> values.
>
> I tried making them required even then they are not serialized
>
> How do i make them serialzed with default values if i dont set any other
> value to them ?
>
> - Kamesh
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03098 seconds