private String getPathParamName(Annotation[] annotations) { for (Annotation a : annotations) { if (a instanceof PathParam) { return ((PathParam) a).value(); } } return null; }
private String getPathParamName(Annotation[] annotations) { for (Annotation a : annotations) { if (a instanceof PathParam) { return ((PathParam) a).value(); } } return null; }
protected String getPathParamName(Annotation[] annotations) { for (Annotation a : annotations) { if (a instanceof PathParam) { return ((PathParam) a).value(); } else if (a instanceof javax.ws.rs.PathParam) { return ((javax.ws.rs.PathParam) a).value(); } } return null; } }
private void handleError(Throwable throwable, PatternPathRouter.RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Optional<Method> methodOptional = new EndpointDispatcher().getOnErrorMethod(webSocketEndpoint); methodOptional.ifPresent(method -> { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach(parameter -> { if (parameter.getType() == Throwable.class) { parameterList.add(throwable); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } } else { parameterList.add(null); } }); executeMethod(method, webSocketEndpoint, parameterList, session); }); }
private void handleError(Throwable throwable, PatternPathRouter.RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Optional<Method> methodOptional = new EndpointDispatcher().getOnErrorMethod(webSocketEndpoint); methodOptional.ifPresent(method -> { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach(parameter -> { if (parameter.getType() == Throwable.class) { parameterList.add(throwable); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } } else { parameterList.add(null); } }); executeMethod(method, webSocketEndpoint, parameterList, session); }); }
@Override public boolean process(Param param, JsrCallable callable) throws InvalidSignatureException { PathParam pathparam = param.getAnnotation(PathParam.class); if(pathparam != null) { param.bind(Role.PATH_PARAM); param.setPathParamName(pathparam.value()); return true; } return false; } }
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
parameterList.add(textCarbonMessage.getText()); } else { parameterList.add(paramValues.get(pathParam.value()));
parameterList.add(textCarbonMessage.getText()); } else { parameterList.add(paramValues.get(pathParam.value()));
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
((PathParam) paramAnnotation).value()); break;
((PathParam) paramAnnotation).value()); break;
PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value()));
((PathParam) paramAnnotation).value()); break;
((PathParam) paramAnnotation).value()); break;