[Json-rpc-java] Serialized object properties - Annotations

Tony Murphy tony_murphy at yahoo.com
Thu Jun 7 16:04:38 SGT 2007


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 


More information about the Json-rpc-java mailing list