@Override public ConstraintTarget getValidationAppliesTo() { throw new UnsupportedOperationException(); }
@Required @Override public ConstraintDescriptor<?> getConstraintDescriptor() { String methodName = "getConstraintDescriptor"; Method method; try { method = MockConstraintViolation.class.getMethod(methodName, new Class<?>[] {}); } catch (NoSuchMethodException | SecurityException e) { throw new IllegalStateException("Failed to get the method: " + methodName, e); } Required annotation = method.getAnnotation(Required.class); return new ConstraintDescriptor<Annotation>() { @Override public Annotation getAnnotation() { return annotation; } @Override public String getMessageTemplate() { return null; } @Override public Set<Class<?>> getGroups() { return DfCollectionUtil.newHashSet(ClientError.class); } @Override public Set<Class<? extends Payload>> getPayload() { return null; } @Override public ConstraintTarget getValidationAppliesTo() { return null; } @Override public List<Class<? extends ConstraintValidator<Annotation, ?>>> getConstraintValidatorClasses() { return null; } @Override public Map<String, Object> getAttributes() { return null; } @Override public Set<ConstraintDescriptor<?>> getComposingConstraints() { return null; } @Override public boolean isReportAsSingleViolation() { return false; } @Override public ValidateUnwrappedValue getValueUnwrapping() { return null; } @Override public <U> U unwrap(Class<U> type) { return null; } }; }
@Override public ConstraintTarget getValidationAppliesTo() { return (ConstraintTarget) this.attributes.get(ConstraintHelper.VALIDATION_APPLIES_TO); }
@Override public ConstraintTarget getValidationAppliesTo() { return ConstraintTarget.PARAMETERS; }