/** * Only accepts if method isn't parameterless and have at least one constraint. */ private boolean hasConstraints(ControllerMethod controllerMethod) { Method method = controllerMethod.getMethod(); if (method.getParameterTypes().length == 0) { logger.debug("method {} has no parameters, skipping", controllerMethod); return false; } BeanDescriptor bean = bvalidator.getConstraintsForClass(controllerMethod.getController().getType()); if(bean == null) { return false; } MethodDescriptor descriptor = bean.getConstraintsForMethod(method.getName(), method.getParameterTypes()); return descriptor != null && descriptor.hasConstrainedParameters(); }
@Override public MethodDescriptor getConstraintsForMethod(final String methodName, final Class<?>... parameterTypes) { throw new UnsupportedOperationException(); }
@Override public Set<MethodDescriptor> getConstrainedMethods(final MethodType methodType, final MethodType... methodTypes) { throw new UnsupportedOperationException(); }
@Override public MethodDescriptor getConstraintsForMethod(final String pmethodName, final Class<?>... pparameterTypes) { // TODO Auto-generated method stub return null; }
@Override public Set<MethodDescriptor> getConstrainedMethods(final MethodType pmethodType, final MethodType... pmethodTypes) { // TODO Auto-generated method stub return null; }