You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Reza Shafii <re...@hotmail.com> on 2007/09/09 03:52:54 UTC
Difficulties with static types
Hi There,
I have used the XSD2Java class to generate static types for the SCA core and java schemas.
I am having some difficulties setting the implementation element of an instantiated Component static type to a JavaImplementation static type instance.
The relevant XSD segments are as follows:
<complexType name="Component">
<sequence>
<element ref="sca:implementation" minOccurs="0" maxOccurs="1"/>
...
<element name="implementation" type="sca:Implementation" abstract="true" />
<complexType name="Implementation" abstract="true">
...
<element name="implementation.java" type="sca:JavaImplementation"
substitutionGroup="sca:implementation"/>
<complexType name="JavaImplementation">
<complexContent>
<extension base="sca:Implementation">
...
However, my generated objects do not seem to allows me any way (at least by using the generated set() method) to set a JavaImplementationImpl instance as the child of a Component instance. Do Tuscany statically generated types support the above XSD constructs?
Thanks,
Reza
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
Re: Difficulties with static types
Posted by Frank Budinsky <fr...@ca.ibm.com>.
Hi Reza,
Substitution groups are tricky to work with in SDO. You need to call
SDOUtil.getSubstitutionValues(), and then set/add the JavaImplementation
property using the Sequence API.
I'm not sure I understand why you're trying to generate static SDO for
this anyway. The SCA project has its own Java classes for the SCA model,
which I would think you should be using.
Frank.
Reza Shafii <re...@hotmail.com> wrote on 09/08/2007 09:52:54 PM:
>
> Hi There,
>
> I have used the XSD2Java class to generate static types for the SCA
> core and java schemas.
>
> I am having some difficulties setting the implementation element of
> an instantiated Component static type to a JavaImplementation static
> type instance.
>
> The relevant XSD segments are as follows:
>
> <complexType name="Component">
> <sequence>
> <element ref="sca:implementation" minOccurs="0" maxOccurs="1"/>
> ...
>
>
> <element name="implementation" type="sca:Implementation" abstract="true"
/>
> <complexType name="Implementation" abstract="true">
> ...
>
>
> <element name="implementation.java" type="sca:JavaImplementation"
> substitutionGroup="sca:implementation"/>
> <complexType name="JavaImplementation">
> <complexContent>
> <extension base="sca:Implementation">
> ...
>
> However, my generated objects do not seem to allows me any way (at
> least by using the generated set() method) to set a
> JavaImplementationImpl instance as the child of a Component
> instance. Do Tuscany statically generated types support the above
> XSD constructs?
>
> Thanks,
>
> Reza
>
> _________________________________________________________________
> Invite your mail contacts to join your friends list with Windows
> Live Spaces. It's easy!
> http://spaces.live.com/spacesapi.aspx?
> wx_action=create&wx_url=/friends.aspx&mkt=en-us
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org