Re: [Simple-support] Problem with override
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2009-02-26 12:57:18
|
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
|