/* (non-Javadoc)
@see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
171036
@Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        try {
            this.duracloudUserService.checkUsername(value);
            return false;
        } catch (InvalidUsernameException ex) {
            return false;
        } catch (UserAlreadyExistsException ex) {
            return true;
        }
    }
245408
public boolean isDataValid() {
    boolean valid = false;
    for (Object value : values.values()) {
      if (value instanceof String) {
        String tt = (String) value;
        if (Strings.isNotBlank(tt)) {
          valid = true;
          break;
        }
      } else {
        if (null != value) {
          valid = true;
          break;
        }
      }
    }
    return valid;
  }
262250
protected boolean validateRequired(final FacesContext context, final Object newValue) {
        // If our value is valid, enforce the required property if present
        if (isValid() && isRequired() && isEmpty(newValue)) {
            final String requiredMessageStr = getRequiredMessage();
            FacesMessage message;
            if (null != requiredMessageStr) {
                message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                            requiredMessageStr,
                            requiredMessageStr);
            }
            else {
                message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                            MESSAGE_REQUIRED,
                            MESSAGE_REQUIRED);
            }
            context.addMessage(getClientId(context), message);
            final Sheet sheet = getSheet();
            if (sheet != null) {
                sheet.getInvalidUpdates().add(
                            new SheetInvalidUpdate(sheet.getRowKeyValue(context), sheet.getColumns().indexOf(this), this, newValue,
                                        message.getDetail()));
            }
            setValid(false);
            return false;
        }
        return true;
    }
386410
public void validate(final ValidationContext context) {
        if (!context.getUserEvent().equalsIgnoreCase("submit")) {
            return;
        }

        val messages = context.getMessageContext();
        ApplicationContextProvider.getCasConfigurationProperties().ifPresent(props -> {
            if (StringUtils.isBlank(source) && props.getAuthn().getPolicy().isSourceSelectionEnabled()) {
                messages.addMessage(new MessageBuilder()
                    .error()
                    .source("source")
                    .code("source.required")
                    .build());
            }
        });
    }
1023728
@Override
    public boolean isValid() {
        if (!_isValid && com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            //only log this if it is invalid
            String s = _isValid + appNameAndIdString;
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "isValid", s);
        }
        return _isValid;
    }
321928
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString;
    if (ignoreSeparators) {
      valueAsString =
          Objects.toString(pvalue, StringUtils.EMPTY).replaceAll("-", StringUtils.EMPTY);
    } else {
      valueAsString = Objects.toString(pvalue, null);
    }
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (!StringUtils.isNumeric(valueAsString)) {
      return false;
    }
    if (valueAsString.length() == Isbn10Validator.ISBN10_LENGTH) {
      // we do have 10 digits, lets test the checksum
      return CHECK_ISBN10.isValid(valueAsString);
    }
    if (valueAsString.length() == Isbn13Validator.ISBN13_LENGTH) {
      // we do have 13 digits, lets test the checksum
      return CHECK_ISBN13.isValid(valueAsString);
    }
    // other sizes are wrong, but this is reported by AlternateSize
    return true;
  }
1010016
private boolean isValidateProperties() {
        return properties != null &&
                properties.containsKey(DB_USERNAME) &&
                properties.containsKey(DB_PASSWORD) &&
                (properties.containsKey(DB_NAME) || properties.containsKey(JDBC_CONNECTION_STRING));
    }
92717
public boolean isValid(HttpServletRequest request) {
    String challenge = request.getParameter(CHALLENGE_FIELD_NAME);
    String response = request.getParameter(RESPONSE_FIELD_NAME);    
    return isValid(request, challenge, response);
  }
561547
public boolean isValid(boolean questionIsRequired) {
		// If required and checked, other types must have text
		if (questionIsRequired && isChecked() && isOtherType && (getOtherText().length() < 1)) {
			otherTextInputLayout.setError(" ");
			return false;
		}
		otherTextInputLayout.setError(null);
		return true;
	}
65180
public static void check(boolean isValid, String message, Object... args) {
    if (!isValid) {
      String[] argStrings = new String[args.length];
      for (int i = 0; i < args.length; i += 1) {
        argStrings[i] = String.valueOf(args[i]);
      }
      throw new ValidationException(
          String.format(String.valueOf(message), (Object[]) argStrings));
    }
  }
1188863
@Override
    public ValidationResult validate(PMContext ctx) {
        final ValidationResult res = new ValidationResult();
        final Object fieldvalue = ctx.getFieldValue();
        res.setSuccessful(fieldvalue != null);
        if (!res.isSuccessful()) {
            res.getMessages().add(MessageFactory.error(
                    ctx.getEntity(), ctx.getField(),
                    get("msg", "pm.validator.not.null"),
                    ctx.getField().getId()));
        }
        return res;
    }
123149
@Override
	public boolean isValid(Object value, ConstraintValidatorContext constraintContext) {
		
		// Si la liste des valeurs permisse est vide : true
		if(values == null || values.length == 0) return true;
		
		// Si l'objet est null : false
		if(value == null) return false;
		
		// Si l'objet est une chaine
		if(value instanceof String) {

			// On caste
			String stringValue = ((String) value).trim();
			
			// Si la chaîne est vide : false
			if(stringValue.length() == 0) return false;
			
			// Si on compare avec casse
			if(caseSensitive) {

				// On recherche la valeur
				for (String authValue : values) {
					
					// Si la valeur est hors des valeurs prescrites
					if(!stringValue.equals(authValue.trim())) return false;
				}
				
			} else {

				// On recherche la valeur
				for (String authValue : values) {
					
					// Si la valeur est hors des valeurs prescrites
					if(!stringValue.equalsIgnoreCase(authValue.trim())) return false;
				}
			}
			
		} else {

			// On recherche la valeur
			for (Object authValue : values) {
				
				// Si la valeur est hors des valeurs prescrites
				if(!value.equals(authValue)) return false;
			}
			
		}
		
		// On retourne false
		return true;
	}
1053875
@Override
  public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) {
    if (StringUtils.isEmpty(pvalue)) {
      return true;
    }
    try {
      // execute regular expression, result doesn't matter
      "x".matches(pvalue);
      return true;
    } catch (final Exception pexception) {
      // regular expression is invalid
      return false;
    }
  }
657693
private boolean isValidElement(String element) {

        boolean validateNewElement = Boolean.valueOf(getParamValidateNewElement()).booleanValue();
        if (ALL.equals(getParamTemplate()) || !validateNewElement) {
            return true;
        }

        return isValidTemplateElement(getParamTemplate(), element);
    }
111717
public boolean isValid() {
		if(parsedHost != null) {
			return true;
		}
		if(validationException != null) {
			return false;
		}
		try {
			validate();
			return true;
		} catch(HostNameException e) {
			return false;
		}
	}
876113
@SuppressWarnings("unused")
    public boolean isValid() {
        Phonenumber.PhoneNumber phoneNumber = getPhoneNumber();
        return phoneNumber != null && mPhoneUtil.isValidNumber(phoneNumber);
    }
1083052
public static void validate(@NotNull Object bean) {
        Assert.notNull(bean, "bean不能为null");
        Set<ConstraintViolation<Object>> constraintViolations = validator.validate(bean);
        check(constraintViolations);
    }