@Override public void validate(final Object value) { if (StringUtils.isEmpty(value)) { throw new InvalidValueException(message); } try { rangeValidator.validate(Integer.parseInt(value.toString())); } catch (final RuntimeException e) { LOGGER.debug("Action expiry validation failed", e); throw new InvalidValueException(message); } }
@Override public void validate(final Object value) { if (StringUtils.isEmpty(value)) { throw new InvalidValueException(message); } try { rangeValidator.validate(Integer.parseInt(value.toString())); } catch (final RuntimeException e) { LOGGER.debug("Action expiry validation failed", e); throw new InvalidValueException(message); } }
public void validate(Object value) throws InvalidValueException { String strValue = ((String)value).trim(); if (!strValue.matches("[0-9]*")) { throw new InvalidValueException( CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_VALIDATOR_EMPTY_OR_NUMBER_0)); } } });
private boolean validateSingleDate(boolean fullRangeFound, DictionaryItemValueWrapper val, Date date) { if (date == null) { if (fullRangeFound) { throw new InvalidValueException(getMessage("validate.item.val.dates")); } else { fullRangeFound = true; } } else { for (DictionaryItemValueWrapper otherVal : modifiedValue) { if (val != otherVal && otherVal.isValidForDate(date)) { throw new InvalidValueException(getMessage("validate.item.val.dates")); } } } return fullRangeFound; }
/** * @see com.vaadin.data.Validator#validate(java.lang.Object) */ public void validate(Object value) throws InvalidValueException { Date date = (Date)value; if (date == null) { throw new InvalidValueException( CmsVaadinUtils.getMessageText(Messages.GUI_PUBLISH_SCHEDULED_DATEEMPTY_0)); } if (date.getTime() < new Date().getTime()) { throw new InvalidValueException( CmsVaadinUtils.getMessageText(Messages.GUI_PUBLISH_SCHEDULED_DATENOTFUTURE_0)); } }
public void validateInternal() { if (!modifiedValue.isEmpty()) { for (Iterator<Component> it = itemsLayout.getComponentIterator(); it.hasNext(); ) { ItemExtensionForm form = (ItemExtensionForm) it.next(); form.commit(); } for (DictionaryItemExtensionWrapper ext : modifiedValue) { for (DictionaryItemExtensionWrapper otherExt : modifiedValue) { if (ext != otherExt && ext.getName().equals(otherExt.getName())) { throw new InvalidValueException(getMessage("validate.item.ext.name.duplicate").replaceFirst("%s", ext.getName())); } } } } }
@Override public void validate(final Object value) { if (value != null && totalTargetsCount != null) { final int maxGroupSize = quotaManagement.getMaxTargetsPerRolloutGroup(); if (getGroupSize() > maxGroupSize) { final String msg = i18n.getMessage(MESSAGE_ROLLOUT_MAX_GROUP_SIZE_EXCEEDED, maxGroupSize); throw new InvalidValueException(msg); } } } }
@SuppressWarnings("squid:S1166") @Override public void validate(final Object value) { try { MaintenanceScheduleHelper.validateCronSchedule((String) value); } catch (final InvalidMaintenanceScheduleException e) { throw new InvalidValueException(i18n.getMessage(CRON_VALIDATION_ERROR) + ": " + e.getMessage()); } } }
/** * @see com.vaadin.data.Validator#validate(java.lang.Object) */ public void validate(Object value) throws InvalidValueException { if (m_fieldOU.isEnabled() && CmsStringUtil.isNotEmptyOrWhitespaceOnly((String)value)) { try { OpenCms.getOrgUnitManager().readOrganizationalUnit(A_CmsUI.getCmsObject(), (String)value); } catch (CmsException e) { throw new InvalidValueException(e.getLocalizedMessage(UI.getCurrent().getLocale())); } } } }
@Override public void validate(final Date value) throws InvalidValueException { super.validate(value); if (value != null && maximumDuration != null && compareTimeOfDates(value, maximumDuration) > 0) { throw new InvalidValueException("value is greater than the allowed maximum value"); } if (value != null && minimumDuration != null && compareTimeOfDates(minimumDuration, value) > 0) { throw new InvalidValueException("value is smaller than the allowed minimum value"); } }
@Override public void validate(final Object value) { if (value != null && totalTargetsCount != null) { final int maxGroupSize = quotaManagement.getMaxTargetsPerRolloutGroup(); if (getGroupSize() > maxGroupSize) { final String msg = i18n.getMessage(MESSAGE_ROLLOUT_MAX_GROUP_SIZE_EXCEEDED, maxGroupSize); throw new InvalidValueException(msg); } } } }
@SuppressWarnings("unchecked") @Override public void validate(Object value) throws InvalidValueException { try { validator.validate((T) value); } catch (ValidationException ve) { throw ValidationUtils.translateValidationException(ve); } catch (Exception e) { throw new InvalidValueException("Invalid value type: " + ExceptionUtils.getRootCauseMessage(e)); } }
@Override public void validate(final Date value) throws InvalidValueException { super.validate(value); if (value != null && maximumDuration != null && compareTimeOfDates(value, maximumDuration) > 0) { throw new InvalidValueException("value is greater than the allowed maximum value"); } if (value != null && minimumDuration != null && compareTimeOfDates(minimumDuration, value) > 0) { throw new InvalidValueException("value is smaller than the allowed minimum value"); } }
/** * @see com.vaadin.data.Validator#validate(java.lang.Object) */ public void validate(Object value) throws InvalidValueException { CmsScheduledJobInfo info = new CmsScheduledJobInfo(); String name = (String)value; try { info.setJobName(name); } catch (CmsIllegalArgumentException e) { throw new InvalidValueException(e.getLocalizedMessage(A_CmsUI.get().getLocale())); } } }
@SuppressWarnings("squid:S1166") @Override public void validate(final Object value) { try { MaintenanceScheduleHelper.validateDuration((String) value); } catch (final InvalidMaintenanceScheduleException e) { throw new InvalidValueException(i18n.getMessage("message.maintenancewindow.duration.validation.error", e.getDurationErrorIndex())); } } }
private void validateXmlSyntaxAndCorrectness() throws Validator.InvalidValueException { try { definitionLoader.unmarshall((String) rawText.getValue()); } catch (Throwable t) { throw new Validator.InvalidValueException(t.getMessage()); } }
@SuppressWarnings("squid:S1166") @Override public void validate(final Object value) { try { MaintenanceScheduleHelper.validateDuration((String) value); } catch (final InvalidMaintenanceScheduleException e) { throw new InvalidValueException(i18n.getMessage("message.maintenancewindow.duration.validation.error", e.getDurationErrorIndex())); } } }
public void validate(Object value) throws InvalidValueException { if (!isValid(value)) { throw new InvalidValueException(i18nManager.getMessage(Messages.USER_ID_UNIQUE)); } } public boolean isValid(Object value) {
@SuppressWarnings("squid:S1166") @Override public void validate(final Object value) { try { MaintenanceScheduleHelper.validateCronSchedule((String) value); } catch (final InvalidMaintenanceScheduleException e) { throw new InvalidValueException(i18n.getMessage(CRON_VALIDATION_ERROR) + ": " + e.getMessage()); } } }
public void validate(Object value) throws InvalidValueException { if (!isValid(value)) { throw new InvalidValueException(i18nManager.getMessage(Messages.GROUP_ID_UNIQUE)); } } public boolean isValid(Object value) {