Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [XSD] EList of Object as operation return type
[XSD] EList of Object as operation return type [message #1499010] Thu, 04 December 2014 21:18 Go to next message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
Hi,

I have an XSD that contains a couple operations and it is working when I refer to types defined in my XSD. However I'm having difficulties specifying an EList<java.lang.Object> as a return type or any other plain Java type . When I do so using the following markup, the returned type specified in the generated code is EObject.
It all looks like the loss of information happens when I go from the XSD to the ecore but I'm not sure why it is happening since I have seen the following markup in other places including the emf.xsd.


<xsd:annotation>
<xsd:appinfo ecore:key="operations" source="http://www.eclipse.org/emf/2002/Ecore">
<operation name="getValue" type="ecore:EEList{ecore:EJavaObject}">
<parameter name="expression" type="xsd:string" />
</operation>

Thanks in advance,

Pascal
Re: [XSD] EList of Object as operation return type [message #1504513 is a reply to message #1499010] Tue, 09 December 2014 10:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Pascal,


On 04/12/2014 10:18 PM, Pascal Rapicault wrote:
> Hi,
>
> I have an XSD that contains a couple operations and it is working when
> I refer to types defined in my XSD. However I'm having difficulties
> specifying an EList<java.lang.Object> as a return type or any other
> plain Java type . When I do so using the following markup, the
> returned type specified in the generated code is EObject.
> It all looks like the loss of information happens when I go from the
> XSD to the ecore but I'm not sure why it is happening since I have
> seen the following markup in other places including the emf.xsd.
Keep in mind that the types such as ecore:EJavaObject must resolve so
you'd need a correspong xsd:import

One trick to try is modify the generated *.ecore to be how you want, and
export it back to an XML Schema and look at the annotations in that *.xsd
>
>
> <xsd:annotation>
> <xsd:appinfo ecore:key="operations"
> source="http://www.eclipse.org/emf/2002/Ecore">
> <operation name="getValue" type="ecore:EEList{ecore:EJavaObject}">
> <parameter name="expression" type="xsd:string" />
> </operation>
>
> Thanks in advance,
>
> Pascal


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Error while running my Eclipse application
Next Topic:[CDO] Invalid signalID on commit
Goto Forum:
  


Current Time: Fri Mar 29 08:00:34 GMT 2024

Powered by FUDForum. Page generated in 0.03117 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top