Search in sources :

Example 1 with DoPut

use of com.tvd12.ezyhttp.server.core.annotation.DoPut in project ezyhttp by youngmonkeys.

the class RequestHandlerMethod method fetchHttpMethod.

protected HttpMethod fetchHttpMethod() {
    DoGet doGet = method.getAnnotation(DoGet.class);
    if (doGet != null) {
        return HttpMethod.GET;
    }
    DoPost doPost = method.getAnnotation(DoPost.class);
    if (doPost != null) {
        return HttpMethod.POST;
    }
    DoPut doPut = method.getAnnotation(DoPut.class);
    if (doPut != null) {
        return HttpMethod.PUT;
    }
    return HttpMethod.DELETE;
}
Also used : DoPost(com.tvd12.ezyhttp.server.core.annotation.DoPost) DoPut(com.tvd12.ezyhttp.server.core.annotation.DoPut) DoGet(com.tvd12.ezyhttp.server.core.annotation.DoGet)

Example 2 with DoPut

use of com.tvd12.ezyhttp.server.core.annotation.DoPut in project ezyhttp by youngmonkeys.

the class RequestHandlerMethod method fetchResponseType.

protected String fetchResponseType() {
    DoGet doGet = method.getAnnotation(DoGet.class);
    if (doGet != null) {
        return DoGetAnnotations.getResponseType(doGet);
    }
    DoPost doPost = method.getAnnotation(DoPost.class);
    if (doPost != null) {
        return DoPostAnnotations.getResponseType(doPost);
    }
    DoPut doPut = method.getAnnotation(DoPut.class);
    if (doPut != null) {
        return DoPutAnnotations.getResponseType(doPut);
    }
    DoDelete doDelete = method.getAnnotation(DoDelete.class);
    return DoDeleteAnnotations.getResponseType(doDelete);
}
Also used : DoPost(com.tvd12.ezyhttp.server.core.annotation.DoPost) DoPut(com.tvd12.ezyhttp.server.core.annotation.DoPut) DoDelete(com.tvd12.ezyhttp.server.core.annotation.DoDelete) DoGet(com.tvd12.ezyhttp.server.core.annotation.DoGet)

Example 3 with DoPut

use of com.tvd12.ezyhttp.server.core.annotation.DoPut in project ezyhttp by youngmonkeys.

the class RequestHandlerMethod method fetchRequestURIFragment.

protected String fetchRequestURIFragment() {
    DoGet doGet = method.getAnnotation(DoGet.class);
    if (doGet != null) {
        return DoGetAnnotations.getURI(doGet);
    }
    DoPost doPost = method.getAnnotation(DoPost.class);
    if (doPost != null) {
        return DoPostAnnotations.getURI(doPost);
    }
    DoPut doPut = method.getAnnotation(DoPut.class);
    if (doPut != null) {
        return DoPutAnnotations.getURI(doPut);
    }
    DoDelete doDelete = method.getAnnotation(DoDelete.class);
    return DoDeleteAnnotations.getURI(doDelete);
}
Also used : DoPost(com.tvd12.ezyhttp.server.core.annotation.DoPost) DoPut(com.tvd12.ezyhttp.server.core.annotation.DoPut) DoDelete(com.tvd12.ezyhttp.server.core.annotation.DoDelete) DoGet(com.tvd12.ezyhttp.server.core.annotation.DoGet)

Aggregations

DoGet (com.tvd12.ezyhttp.server.core.annotation.DoGet)3 DoPost (com.tvd12.ezyhttp.server.core.annotation.DoPost)3 DoPut (com.tvd12.ezyhttp.server.core.annotation.DoPut)3 DoDelete (com.tvd12.ezyhttp.server.core.annotation.DoDelete)2