/*
(non-Javadoc)

@see
com.fs.commons.desktop.validation.Validator#validate(com.fs.commons.desktop.
validation.Problems, java.lang.String, java.lang.Object)
7757
@Override
	public boolean validate(final Problems problems, final String compName, final String model) {
		final char[] c = model.toCharArray();
		boolean result = true;
		String curr;
		for (final char element : c) {
			curr = new String(new char[] { element });
			try {
				final String nue = new String(curr.getBytes(this.charsetName));
				result = element == nue.charAt(0);
				if (!result) {
					problems.add(
							ValidationBundle.getMessage(EncodableInCharsetValidator.class, "INVALID_CHARACTER", compName, curr, this.charsetName)); // NOI18N
					break;
				}
			} catch (final UnsupportedEncodingException ex) {
				// Already tested in constructor
				throw new AssertionError(ex);
			}
		}
		return result;
	}
218702
public void validate(Object o)
    {
        if (o != null && o instanceof Comparable)
        {
            compareMinExclusive((Comparable<?>)o);
            compareMinInclusive((Comparable<?>)o);
            compareMaxExclusive((Comparable<?>)o);
            compareMaxInclusive((Comparable<?>)o);
        }
    }
404430
@Override
	public List<ParsingError> doValidate() {

		List<ParsingError> result = new ArrayList<> ();
		if( Utils.isEmptyOrWhitespaces( this.targetId ))
			result.add( error( ErrorCode.CMD_INVALID_TARGET_ID, value( this.targetId )));

		Instance resolvedInstance;
		if(( resolvedInstance = this.context.resolveInstance( this.scopedInstancePath )) == null)
			result.add( error( ErrorCode.CMD_NO_MATCHING_INSTANCE, instance( this.scopedInstancePath )));
		else if( ! InstanceHelpers.isTarget( resolvedInstance ))
			result.add( error( ErrorCode.CMD_NOT_A_SCOPED_INSTANCE ));

		return result;
	}
1025079
@Override
    public void validate() throws OpsGenieClientValidationException {
        super.validate();
        if (getName() == null)
            throw OpsGenieClientValidationException.missingMandatoryProperty(OpsGenieClientConstants.API.NAME);
    }
349457
@Override
    public void validate() {
        //validate the parameters
        String target = getTargetName();
        if (value() < 1) {
            throw new FaultToleranceDefinitionException(Tr.formatMessage(tc, "bulkhead.parameter.invalid.value.CWMFT5016E", "value ", value(), target));
        }
        //validate the parameters
        if (waitingTaskQueue() < 1) {
            throw new FaultToleranceDefinitionException(Tr.formatMessage(tc, "bulkhead.parameter.invalid.value.CWMFT5016E", "waitingTaskQueue", waitingTaskQueue(),
                                                                         target));
        }

    }
1275566
@Override
    public void validate() throws OpsGenieClientValidationException {
        super.validate();
        if (id == null && alias == null)
            throw OpsGenieClientValidationException.missingMultipleMandatoryProperty(OpsGenieClientConstants.API.ALIAS,
                    OpsGenieClientConstants.API.ID);
    }
113803
public void validate(Object o)
    {
        if (o != null && o instanceof String)
        {
            int l = ((String)o).length();
            if (m_minLength != -1 && l < m_minLength)
            {
                String message = m_propertyMetadata.getMessageSourceAccessor().getMessage(m_message, new Object[]{ m_propertyMetadata.getLabelName(), m_minLength,m_maxLength,String.valueOf(o) });
                throw new ValidationException(message);                
            }
            if (m_maxLength != -1 && l > m_maxLength)
            {
                String message = m_propertyMetadata.getMessageSourceAccessor().getMessage(m_message, new Object[]{ m_propertyMetadata.getLabelName(),m_minLength,m_maxLength, String.valueOf(o) });
                throw new ValidationException(message);                
            }
        }
    }
347524
@Override
	public boolean validate(final Problems problems, final String compName, final String text) {
		try {
			final double d = Double.parseDouble(text);
			if (d < 0D) {
				final String problem = ValidationBundle.getMessage(NonNegativeNumberValidator.class, "ERR_NEGATIVE_NUMBER", compName); // NOI18N
				problems.add(problem);
				return false;
			}
		} catch (final NumberFormatException e) {
			// do nothing - if someone wants not-a-number validation, they
			// should
			// chain an IntegerDocumentValidator or similar
		}
		return true;
	}
1058685
@Override
	public boolean validate(final Problems problems, final String compName, final String model) {
		if (model == null) {
			return false;
		}
		final boolean result = model.length() <= this.len;
		if (!result) {
			problems.add(ValidationBundle.getMessage(MaximumLength.class, "STRING_TOO_LONG", compName, model, "" + this.len)); // NOI18N
		}
		return result;
	}
1196041
@Override
  public void validate() {
    int n = 0;
    try {
      for (TiffObject o : model.getImageIfds()) {
        IFD ifd = (IFD) o;
        IfdTags metadata = ifd.getMetadata();
        validateMetadata(metadata);
        checkImage(ifd, n, metadata);
        n++;
      }
    } catch (Exception ex) {

    }
  }
236145
@Override
	public boolean validate(final Problems problems, final String compName, final String model) {
		final char[] chars = model.toCharArray();
		for (final char c : chars) {
			if (Character.isWhitespace(c)) {
				problems.add(ValidationBundle.getMessage(MayNotContainSpacesValidator.class, "MAY_NOT_CONTAIN_WHITESPACE", compName)); // NOI18N
				return false;
			}
		}
		return true;
	}
1082446
@Override
    public void validate() throws OpsGenieClientValidationException {
        super.validate();
        if (name == null && id == null)
            throw OpsGenieClientValidationException.missingMultipleMandatoryProperty(OpsGenieClientConstants.API.NAME, OpsGenieClientConstants.API.ID);
    }
1358661
public void validate(final Runnable nextAction) {

        validateFull(m_structureId, getAliasPaths(), new AsyncCallback<Map<String, String>>() {

            public void onFailure(Throwable caught) {

                // do nothing

            }

            public void onSuccess(Map<String, String> result) {

                for (Map.Entry<String, String> entry : result.entrySet()) {
                    if (entry.getValue() != null) {
                        m_hasValidationErrors = true;
                    }
                }
                m_defaultValidationHandler.onSuccess(result);
                nextAction.run();
            }
        });
    }
408903
@Override
    public ValidationResult validate(Object value) {
        if (value == null || value instanceof String) {
            return new ValidationResult.ValidationPassed();
        } else {
            return new ValidationResult.ValidationFailed("Value \"" + value + "\" is not a valid string!");
        }
    }
1263924
@Override
	public boolean validate(final Problems problems, final String compName, final String model) {
		Exception e = null;
		try {
			Charset.forName(model);
		} catch (final IllegalCharsetNameException badName) {
			problems.add(ValidationBundle.getMessage(CharsetValidator.class, "ILLEGAL_CHARSET_NAME", compName, model)); // NOI18N
			e = badName;
		} catch (final UnsupportedCharsetException unsup) {
			problems.add(ValidationBundle.getMessage(CharsetValidator.class, "UNSUPPORTED_CHARSET_NAME", compName, model)); // NOI18N
			e = unsup;
		}
		return e == null;
	}
974684
@Override
	public void validate(final List<Diagnostic> diags) {
		// Validate each row.
		List beanList = this.getBeanList();
		WComponent row = getRepeatedComponent();

		for (int i = 0; i < beanList.size(); i++) {
			Object rowData = beanList.get(i);
			UIContext rowContext = getRowContext(rowData, i);

			UIContextHolder.pushContext(rowContext);

			try {
				row.validate(diags);
			} finally {
				UIContextHolder.popContext();
			}
		}
	}
963267
public void addValidation(Object key, Validation validation){
        initMapOnce();
        validations.put(key, validation);
        // update aggregated value
        passedAll = passedAll && validation.passed();
    }