[Simple-support] reference a field of an instance variable
Brought to you by:
niallg
|
From: Quirino Z. <qu...@la...> - 2008-02-08 12:44:26
|
Hi,
I've been watching the Simple Framework and I found it very useful and
pretty complete.
I looked at tutorials and javadocs and I wondered if it's possible to
serialize only a single field of a complex instance variable. I'll show it
with an example to make it more clear.
public class Class1{
@Element
private Class3 class3;
@Attribute
private long id;
}
public class Class2{
//I want to serialize only the id of the class1 variable, not the
whole state
@Attribute(name="class1" references=Class1.id)
private Class1 class1;
}
I'm using Simple to serialize AJAX responses and this feature could be very
useful when you want to show a list of items(i.e. products in e-commerce
apps), but you don't want to load all related data.
Sorry for my English.
Regards
--
Quirino Zagarese
LaszloItalia Founder (www.laszloitalia.org)
Software Development Manager - Galilaeus s.r.l. (www.galilaeus.net)
|