users@jersey.java.net

[Jersey] custom parameter in Json object

From: Jordan Blay <be.special_at_gmail.com>
Date: Sun, 25 Dec 2011 02:14:46 -0800 (PST)

I saw this article:
http://codahale.com/what-makes-jersey-interesting-parameter-classes/ about
how to create my own datatype.

However, what if I want to use this type in JSON object?

For instance, I would like the following object:

@XmlRootElement
public class GiftOrder extends Base {
   String instructions;
        DateParam deliveryDate;
}

And I would like that the user will only send string as deliveryDate.

I defined a constructor that accepts String like this:

public DateParam(String param) {
                int i=5;
                System.out.println(i);
        }

but it doesn't reach it.. what needs to be my object in order to make it
working?

--
View this message in context: http://jersey.576304.n2.nabble.com/custom-parameter-in-Json-object-tp7126063p7126063.html
Sent from the Jersey mailing list archive at Nabble.com.