Package org.apache.wink.providers.jackson.internal.jaxb

Examples of org.apache.wink.providers.jackson.internal.jaxb.Person


    @Path("/test/person")
    public static class PersonResource {

        @GET
        public Person getPerson() throws IOException {
            Person p = new Person();
            p.setName("My Name");
            p.setDesc("My desc");
            return p;
        }
View Full Code Here


        @GET
        @Path("collection")
        public List<Person> getPeopleCollection() throws IOException {
            List<Person> people = new ArrayList<Person>();
            Person p = new Person();
            p.setName("My Name");
            p.setDesc("My desc");
            people.add(p);
            p = new Person();
            p.setName("My Name 2");
            p.setDesc("My desc 2");
            people.add(p);
            return people;
        }
View Full Code Here

    @Path("/test/person")
    public static class PersonResource {

        @GET
        public Person getPerson() throws IOException {
            Person p = new Person();
            p.setName("My Name");
            p.setDesc("My desc");
            return p;
        }
View Full Code Here

        JSONObject person = (JSONObject)result.get("person");
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", person.get("name"));
        jsonObject.put("desc", person.get("desc"));
        jsonObject.put("age", person.get("age"));
        Person p =
            (Person)jacksonProvider.readFrom(Object.class,
                                             Person.class,
                                             null,
                                             MediaType.APPLICATION_JSON_TYPE,
                                             null,
                                             new ByteArrayInputStream(jsonObject.toString()
                                                 .getBytes()));
        assertEquals("myName", p.getName());
        assertEquals("myDescription", p.getDesc());
        assertEquals(100, p.getAge());
    }
View Full Code Here

    @Path("/person")
    public static class PersonResource {

        @GET
        public Person getPerson() {
            Person p = new Person();
            p.setName("myName");
            p.setDesc("myDescription");
            p.setAge(100);
            return p;
        }
View Full Code Here

        @GET
        @Path("collection")
        public List<Person> getPeopleCollection() throws IOException {
            List<Person> people = new ArrayList<Person>();
            Person p = new Person();
            p.setName("My Name");
            p.setDesc("My desc");
            p.setAge(20);
            people.add(p);
            p = new Person();
            p.setName("My Name 2");
            p.setDesc("My desc 2");
            people.add(p);
            p.setAge(22);
            return people;
        }
View Full Code Here

    @Path("/test/person")
    public static class PersonResource {

        @GET
        public Person getPerson() throws IOException {
            Person p = new Person();
            p.setName("My Name");
            p.setDesc("My desc");
            p.setAge(100);
            return p;
        }
View Full Code Here

TOP

Related Classes of org.apache.wink.providers.jackson.internal.jaxb.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.