/** * Reports an error against an <code>IValidatable</code> instance using the <code>Map</code> * returned by {@link #variablesMap(IValidatable)} for variable interpolations and the message * resource key returned by {@link #resourceKey()}. * * @param validatable * the <code>IValidatable</code> instance being validated * */ public void error(final IValidatable validatable) { error(validatable, resourceKey(), variablesMap(validatable)); }
/** * Reports an error against an <code>IValidatable</code> instance using the given * <code>Map</code> for variable interpolations and message resource key provided by * {@link #resourceKey()}. * * @param validatable * the <code>IValidatable</code> instance being validated * @param vars * <code>Map</code> of variables for variable interpolation */ public void error(final IValidatable<T> validatable, final Map<String, Object> vars) { if (vars == null) { throw new IllegalArgumentException("Argument [[vars]] cannot be null"); } error(validatable, resourceKey(), vars); }
/** * Reports an error against an <code>IValidatable</code> instance using the <code>Map</code> * returned by {@link #variablesMap(IValidatable)} for variable interpolations and the given * message resource key. * * @param validatable * the <code>IValidatable</code> instance being validated * @param resourceKey * the message resource key to use * */ public void error(final IValidatable<T> validatable, String resourceKey) { if (resourceKey == null) { throw new IllegalArgumentException("Argument [[resourceKey]] cannot be null"); } error(validatable, resourceKey, variablesMap(validatable)); }
/** * @see IValidator#validate(IValidatable) */ public final void validate(IValidatable<T> validatable) { if (validatable.getValue() != null || validateOnNullValue()) { onValidate(validatable); } }
@Override protected Map<String, Object> variablesMap(IValidatable<Date> validatable) { final Map<String, Object> map = super.variablesMap(validatable); final Date date = validatable.getValue(); if (date == null) { return map; } final String dateLabel = DateTimePrinter.of(date).print(FormatStyle.LONG, FormatStyle.MEDIUM); map.put(INPUTDATE_LABEL, dateLabel); return map; }
/** * Reports an error against an <code>IValidatable</code> instance using the <code>Map</code> * returned by {@link #variablesMap(IValidatable)} for variable interpolations and the given * message resource key. * * @param validatable * the <code>IValidatable</code> instance being validated * @param resourceKey * the message resource key to use * */ public void error(final IValidatable validatable, String resourceKey) { if (resourceKey == null) { throw new IllegalArgumentException("Argument [[resourceKey]] cannot be null"); } error(validatable, resourceKey, variablesMap(validatable)); }
/** * @see IValidator#validate(IValidatable) */ public final void validate(IValidatable validatable) { if (validatable.getValue() != null || validateOnNullValue()) { onValidate(validatable); } }
/** * Reports an error against an <code>IValidatable</code> instance using the given * <code>Map</code> for variable interpolations and message resource key provided by * {@link #resourceKey()}. * * @param validatable * the <code>IValidatable</code> instance being validated * @param vars * <code>Map</code> of variables for variable interpolation */ public void error(final IValidatable validatable, final Map vars) { if (vars == null) { throw new IllegalArgumentException("Argument [[vars]] cannot be null"); } error(validatable, resourceKey(), vars); }
/** * Reports an error against an <code>IValidatable</code> instance using the <code>Map</code> * returned by {@link #variablesMap(IValidatable)} for variable interpolations and the message * resource key returned by {@link #resourceKey()}. * * @param validatable * the <code>IValidatable</code> instance being validated * */ public void error(final IValidatable<T> validatable) { error(validatable, resourceKey(), variablesMap(validatable)); }