Class GetMethodImplementor

    • Constructor Detail

      • GetMethodImplementor

        public GetMethodImplementor​(boolean isResteasyClassic,
                                    boolean isReactivePanache)
    • Method Detail

      • implementInternal

        protected void implementInternal​(io.quarkus.gizmo.ClassCreator classCreator,
                                         ResourceMetadata resourceMetadata,
                                         ResourceProperties resourceProperties,
                                         io.quarkus.gizmo.FieldDescriptor resourceField)
        Generate JAX-RS GET method. The RESTEasy Classic version exposes RestDataResource.get(Object). and the generated code looks more or less like this:
         
             @GET
             @Produces({"application/json"})
             @Path("{id}")
             @LinkResource(
                 rel = "self",
                 entityClassName = "com.example.Entity"
             )
             public Response get(@PathParam("id") ID id) {
                 try {
                     Entity entity = restDataResource.get(id);
                     if (entity != null) {
                         return entity;
                     } else {
                         return Response.status(404).build();
                     }
                 } catch (Throwable t) {
                     throw new RestDataPanacheException(t);
                 }
             }
         
         
        The RESTEasy Reactive version exposes ReactiveRestDataResource.delete(Object) and the generated code looks more or less like this:
         
             @GET
             @Produces({"application/json"})
             @Path("{id}")
             @LinkResource(
                 rel = "self",
                 entityClassName = "com.example.Entity"
             )
             public Uni<Response> get(@PathParam("id") ID id) {
                 try {
                     return restDataResource.get(id).map(entity -> entity == null ? Response.status(404).build() : Response.ok(entity).build());
                 } catch (Throwable t) {
                     throw new RestDataPanacheException(t);
                 }
             }
         
         
        Specified by:
        implementInternal in class StandardMethodImplementor