Re: [Simple-support] Problem with override
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2009-02-27 12:45:41
|
Hi,
Actually, you are right, it will call all instances "reference". Did not see the different types mentioned. Here the problem is how to match the element with the field. If the names do not match, either by field name or by the name attribute on the annotation then there is no real way to match the element or attribute with the field or method.
However, I welcome any proposals for how to do this, either via an extra annotation or some other scheme.
Thanks,
Niall
--- On Thu, 2/26/09, saurabh sule <sau...@ya...> wrote:
From: saurabh sule <sau...@ya...>
Subject: Re: [Simple-support] Problem with override
To: gal...@ya..., "sim...@li..." <sim...@li...>, "Sacchi Giovanna" <gio...@te...>
Date: Thursday, February 26, 2009, 6:12 PM
Hi,
But this solution will always serialize the Formula to "reference", am I right?
What if one wants to have "reference" , "constant" or "function" depending on the actual implementation?
Is this possible?
Regards,
Saurabh.
From: Niall Gallagher <gal...@ya...>
To: "sim...@li..." <sim...@li...>; Sacchi Giovanna <gio...@te...>
Sent: Thursday, 26 February, 2009 6:20:32 PM
Subject: Re: [Simple-support] Problem with override
Hi,
Just name the @Element like so.
@Element(name="reference")
Formula formula;
This will serialize the Formula class as "reference".
Hope this helps,
Niall
--- On Thu, 2/26/09, Sacchi Giovanna <gio...@te...> wrote:
From: Sacchi Giovanna <gio...@te...>
Subject: [Simple-support]
Problem with override
To: "sim...@li..." <sim...@li...>
Date: Thursday, February 26, 2009, 3:13 AM
Hi,
I’m trying to serialize a class similar to this one:
public
class
Binding {
@Attribute
private
Type type;
@Attribute
private
String name;
@Attribute
private
Side side;
@Attribute
(required=false)
private
String part;
@Element
private
Formula formula;
...
}
Where Formula is an interface implemented by three classes: Constant, Function and Reference. For instance,
I have annotated the Reference class, like that:
public
class
Reference implements
Formula {
@Attribute
private
String activity;
@Attribute
private
Type type;
@Attribute
private
String name;
@Attribute
private
Side side;
...
}
When the Binding class is serialized the following xml file is produced:
<binding
type="NORMAL"
name="par21"
side="IN">
<formula
class="com.tilab.wemash.model.Reference"
activity="webServiceActivity1"
type="NORMAL"
name="par11"
side="OUT"/>
</binding>
I would like to know if it there is any way to produce, instead, the following xml:
<binding
type="NORMAL"
name="par21"
side="IN">
<reference
class="com.tilab.wemash.model.Reference"
activity="webServiceActivity1"
type="NORMAL"
name="par11"
side="OUT"/>
</binding>
That is: when the element formula of the Binding is serialized, I want that the name of the class Reference
is used as element name instead of the name of the interface implemented by the class Reference.
Regards,
Giovanna
------------------------------------------------------------------
Telecom Italia
Giovanna Sacchi
Information Technology
Innovation, Architecture & Quality
IT Innovation
Via G. Reiss Romoli, 274 - 10148 Torino
+ 39 011 2288040
+ 39 331 6001656
Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi
altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.
This e-mail and any attachments is confidential
and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender
by return e-mail, Thanks.
Rispetta l'ambiente. Non stampare questa mail se non è necessario.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
Add more friends to your messenger and enjoy! Invite them now.
|