Search in sources :

Example 1 with Serializer

use of br.com.caelum.vraptor.serialization.Serializer in project restfulie-java by caelum.

the class OrderingController method get.

@Get
@Path("/orders/{order.id}")
public void get(Order order) {
    order = database.getOrder(order.getId());
    if (order != null) {
        Serializer serializer = result.use(representation()).from(order);
        serializer.include("items").include("location");
        serializer.include("payment").serialize();
    } else {
        status.notFound();
    }
}
Also used : Serializer(br.com.caelum.vraptor.serialization.Serializer) Path(br.com.caelum.vraptor.Path) Get(br.com.caelum.vraptor.Get)

Aggregations

Get (br.com.caelum.vraptor.Get)1 Path (br.com.caelum.vraptor.Path)1 Serializer (br.com.caelum.vraptor.serialization.Serializer)1