Class GetMethodImplementor

java.lang.Object
io.quarkus.rest.data.panache.deployment.methods.StandardMethodImplementor
io.quarkus.rest.data.panache.deployment.methods.GetMethodImplementor
All Implemented Interfaces:
MethodImplementor

public final class GetMethodImplementor extends StandardMethodImplementor
  • Constructor Details

    • GetMethodImplementor

      public GetMethodImplementor(io.quarkus.deployment.Capabilities capabilities)
  • Method Details

    • 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
    • getResourceMethodName

      protected String getResourceMethodName()
      Description copied from class: StandardMethodImplementor
      Get a name of a method which this controller uses to access data.
      Specified by:
      getResourceMethodName in class StandardMethodImplementor