All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blade.mvc.hook.Signature Maven / Gradle / Ivy

There is a newer version: 2.0.15.RELEASE
Show newest version
package com.blade.mvc.hook;

import com.blade.mvc.RouteContext;
import com.blade.mvc.http.Request;
import com.blade.mvc.http.Response;
import com.blade.mvc.route.Route;
import lombok.*;

import java.lang.reflect.Method;

/**
 * Signature
 *
 * @author biezhi
 * 2017/6/2
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Deprecated
public class Signature {

    private static final String LAMBDA = "$$Lambda$";

    private Route    route;
    private Method   action;
    private Request  request;
    private Response response;
    private Object[] parameters;

    private RouteContext routeContext;

    public Request request() {
        return request;
    }

    public Response response() {
        return response;
    }

    public RouteContext routeContext() {
        return new RouteContext(request, response);
    }

    public boolean next() {
        return true;
    }

    public void setRoute(Route route) throws Exception {
        this.route = route;
        this.action = route.getAction();
        if (null != this.action &&
                !this.action.getDeclaringClass().getName().contains(LAMBDA)) {
//            this.parameters = MethodArgument.getArgs(this);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy