[Json-rpc-java] Serialized object properties - Annotations
Tony Murphy
tony_murphy at yahoo.com
Thu Jun 7 20:21:01 SGT 2007
Thanks for your reply Dan. Think it might impact other parts of system though as these business objects are persisted using hibernate and some are in the servlet session and I'd like them to be fully serializable then
Tony
----- Original Message ----
From: "Cosio, Dan" <dcosio at opsecsecurity.com>
To: Tony Murphy <tony_murphy at yahoo.com>; json-rpc-java at oss.metaparadigm.com
Sent: Thursday, 7 June, 2007 1:05:42 PM
Subject: RE: [Json-rpc-java] Serialized object properties - Annotations
Why not make them transient variables.. They will not be serialized when
the object is passed back to the caller..
Dan
GenuNet Online Brand and Channel Protection
Dan Cosio
Software Engineer
Genuone, Inc., division of OpSec Security Group
320 Congress St, 7th Floor Boston, MA 02210
dcosio at opsecsecurity.com
tel:
mobile:
617-226-3026
617-283-0088
Add me to your address book...
Want a signature like this?
-----Original Message-----
From: json-rpc-java-bounces at oss.metaparadigm.com
[mailto:json-rpc-java-bounces at oss.metaparadigm.com] On Behalf Of Tony
Murphy
Sent: Thursday, June 07, 2007 4:05 AM
To: json-rpc-java at oss.metaparadigm.com
Subject: [Json-rpc-java] Serialized object properties - Annotations
I've just started using JSON-RPC-Java and I think it's great.
I did have one question - is there a way to define what object
properties get serialized? I think it would be useful.
For example:
I return a List of Orders to a customer, some of the properties in the
Order object may not be for the customer eyes (e.g.
customerServiceNotes)
public class Order {
private String orderNumber;
private String description;
private String customerServiceNotes;
...
public String getOrderNumber() {
return order;
}
public String getDescription() {
return description;
}
/**
* Don't want the user seeing these!
*/
@JSON_NO_SERIALIZE
public String getCustomerServiceNotes() {
}
}
Maybe an annotation could be used to tell JSON-RPC-Java not to serialize
a property?
I had a look at http://flexjson.sourceforge.net/ and it helps explain
the issue
___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign
up for
your free account today
http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07
.html
_______________________________________________
Json-rpc-java mailing list
Json-rpc-java at oss.metaparadigm.com
http://oss.metaparadigm.com/mailman/listinfo/json-rpc-java
___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/
More information about the Json-rpc-java
mailing list