org.springframework.network.NetworkWebArgumentResolver Maven / Gradle / Ivy
package org.springframework.network;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.support.WebArgumentResolver;
import org.springframework.web.context.request.NativeWebRequest;
public class NetworkWebArgumentResolver implements WebArgumentResolver {
@Override
public Object resolveArgument(MethodParameter param, NativeWebRequest request) throws Exception {
if (Network.class.isAssignableFrom(param.getParameterType())) {
return NetworkUtils.getCurrentNetwork(request);
}
else {
return WebArgumentResolver.UNRESOLVED;
}
}
}