/** * Useful in case that you want to mock some services via setters. */ public Application getApplication() { return pippo.getApplication(); }
@Override public void addRouteGroup(RouteGroup routeGroup) { getApplication().addRouteGroup(routeGroup); }
@Override public void addRoute(Route route) { getApplication().addRoute(route); }
this.server.init(getApplication());
@Override public Object serialize(ObjectMapperSerializationContext context) { ContentTypeEngine engine = pippo.getApplication().getContentTypeEngine(context.getContentType()); if (engine == null) { throw new PippoRuntimeException("No ContentTypeEngine registered for {}", context.getContentType()); } return engine.toString(context.getObjectToSerialize()); }
@Override public Object deserialize(ObjectMapperDeserializationContext context) { ContentTypeEngine engine = pippo.getApplication().getContentTypeEngine(context.getContentType()); if (engine == null) { throw new PippoRuntimeException("No ContentTypeEngine registered for {}", context.getContentType()); } return engine.fromString(context.getDataToDeserialize().asString(), context.getType()); }
/** * Useful in case that you want to mock some services via setters. */ public Application getApplication() { return pippo.getApplication(); }
@Override public Object serialize(ObjectMapperSerializationContext context) { ContentTypeEngine engine = pippo.getApplication().getContentTypeEngine(context.getContentType()); if (engine == null) { throw new PippoRuntimeException("No ContentTypeEngine registered for {}", context.getContentType()); } return engine.toString(context.getObjectToSerialize()); }
@Override public Object deserialize(ObjectMapperDeserializationContext context) { ContentTypeEngine engine = pippo.getApplication().getContentTypeEngine(context.getContentType()); if (engine == null) { throw new PippoRuntimeException("No ContentTypeEngine registered for {}", context.getContentType()); } return engine.fromString(context.getDataToDeserialize().asString(), context.getType()); }