Sets up a validator for the specified field.

@param field Field on which a validator should be installed.

@return Property representing the result of the field validation and that can be used for tab-wise validation.
189676
private ReadableProperty<Boolean> installFieldValidation(JTextField field) {
        // FieLd is valid if not empty
        SimpleBooleanProperty fieldResult = new SimpleBooleanProperty();
        on(new JTextFieldDocumentChangedTrigger(field)) //
                .read(new JTextFieldTextProvider(field)) //
                .check(new StringNotEmptyRule()) //
                .handleWith(new IconBooleanFeedback(field)) //
                .handleWith(fieldResult) //
                .getValidator().trigger();

        // Tab will be valid only if all fields are valid
        return fieldResult;
    }
1050534
@Override
    public boolean validate(Field field, Object fieldValue, IRule... rules) throws RuleValidationException
    {

        if (rules == null)
        {
            return super.validate(field, fieldValue, this.ruleFactory.getJpaRules());
        }
        
        else
        {
            return super.validate(field, fieldValue, rules);
        }

    }
281701
function validateField (fields, key) {
  var value = fields[key] = castShorthand(fields[key])

  if (typeof value !== 'object')
    throw new TypeError('The definition of "' + key + '" must be an object.')

  if (key === primaryKey)
    throw new Error('Can not define primary key "' + primaryKey + '".')

  if (key in plainObject)
    throw new Error('Can not define field name "' + key +
      '" which is in Object.prototype.')

  if (!value[typeKey] && !value[linkKey])
    throw new Error('The definition of "' + key + '" must contain either ' +
      'the "' + typeKey + '" or "' + linkKey + '" property.')

  if (value[typeKey] && value[linkKey])
    throw new Error('Can not define both "' + typeKey + '" and "' + linkKey +
      '" on "' + key + '".')

  if (value[typeKey]) {
    if (typeof value[typeKey] === 'string')
      value[typeKey] = nativeTypes[
        stringifiedTypes.indexOf(value[typeKey].toLowerCase())]

    if (typeof value[typeKey] !== 'function')
      throw new Error('The "' + typeKey + '" on "' + key +
        '" must be a function.')

    if (!find(nativeTypes, function (type) {
      var hasMatch = type === value[typeKey] ||
        type.name === value[typeKey].name

      // In case this errors due to security sandboxing, just skip this check.
      if (!hasMatch)
        try {
          hasMatch = Object.create(value[typeKey]) instanceof type
        }
        catch (e) {
          hasMatch = true
        }

      return hasMatch
    }))
      throw new Error('The "' + typeKey + '" on "' + key + '" must be or ' +
        'inherit from a valid native type.')

    if (value[inverseKey])
      throw new Error('The field "' + inverseKey + '" may not be defined ' +
        'on "' + key + '".')
  }

  if (value[linkKey]) {
    if (typeof value[linkKey] !== 'string')
      throw new TypeError('The "' + linkKey + '" on "' + key +
        '" must be a string.')

    if (value[inverseKey] && typeof value[inverseKey] !== 'string')
      throw new TypeError('The "' + inverseKey + '" on "' + key + '" ' +
        'must be a string.')
  }

  if (value[isArrayKey] && typeof value[isArrayKey] !== 'boolean')
    throw new TypeError('The key "' + isArrayKey + '" on "' + key + '" ' +
        'must be a boolean.')
}
780034
public ASTField getField(Field field) {
        ASTAccessModifier modifier = ASTAccessModifier.getModifier(field.getModifiers());

        return new ASTClassField(field, getType(field.getType(), field.getGenericType()), modifier, getAnnotations(field));
    }
752924
public Object getFieldActualValue(final String field) {
        final String fieldPath = buildFieldPath(field);
        return propertyValueNavigator.getProperty(target, fieldPath);
    }
901844
function(field, validation) {
            var
              $field        = module.get.field(field.identifier),
              type          = validation.type,
              value         = $field.val() + '',

              bracketRegExp = /\[(.*?)\]/i,
              bracket       = bracketRegExp.exec(type),
              isValid       = true,
              ancillary,
              functionType
            ;
            // if bracket notation is used, pass in extra parameters
            if(bracket !== undefined && bracket !== null) {
              ancillary    = '' + bracket[1];
              functionType = type.replace(bracket[0], '');
              isValid      = $.proxy(settings.rules[functionType], $module)(value, ancillary);
            }
            // normal notation
            else {
              isValid = $.proxy(settings.rules[type], $field)(value);
            }
            return isValid;
          }
25766
public function validateField(Field $field)
    {
        if (false === $this->fieldWasValidated($field)) {
            $this->checkFieldActivation($field);

            if (false === $this->result->fieldIsDeactivated($field)) {
                $this->markFieldAsValidated($field);

                // Looping on the field's validation settings...
                foreach ($field->getValidation() as $validation) {
                    if ($this->result->validationIsDeactivated($validation)) {
                        continue;
                    }

                    $validatorResult = $this->processFieldValidation($field, $validation);

                    // Breaking the loop if an error occurred: we stop the validation process for the current field.
                    if ($validatorResult->hasErrors()) {
                        break;
                    }
                }
            }
        }
    }
580017
public void addValidator(final FieldValidator validator) {
		WComponent labelField = findComponentForLabel(field);

		if (labelField instanceof Input) {
			((Input) labelField).addValidator(validator);
		}
	}
981675
public Notification setFieldValue(String field, @Nullable String value) {
    fields.put(field, value);
    return this;
  }
809164
public void addError(String field, String error) {
		Assert.notNull(field, "field must not be null");
		Assert.notNull(error, "field must not be null");

		addErrors(field, Collections.singletonList(error));

		addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE);
	}
1098514
public FormInputValidator valueGreaterThan (VisValidatableTextField field, String errorMsg, float value, boolean validIfEqualsValue) {
		ValidatorWrapper wrapper = new ValidatorWrapper(errorMsg, new GreaterThanValidator(value, validIfEqualsValue));
		field.addValidator(wrapper);
		add(field);
		return wrapper;
	}
758119
@JsOverlay
  public final void addJavaPropValidator(Function javaMethod, String propertyName) {
    PropOptions propDefinition = getProps().get(propertyName);
    propDefinition.validator = javaMethod;
  }
1073549
public FormInputValidator custom (VisValidatableTextField field, FormInputValidator customValidator) {
		field.addValidator(customValidator);
		add(field);
		return customValidator;
	}
438918
void bindField(AbstractField<?> field, String property) {

        m_group.bind(field, property);

        field.setCaption(CmsVaadinUtils.getMessageText("label." + property));
        field.setDescription(CmsVaadinUtils.getMessageText("label." + property + ".help"));
    }
416937
public static PropertyMetadata getPropertyMetadata(Field field) {
    Property property = field.getAnnotation(Property.class);
    // For fields that have @Property annotation, we expect both setter and
    // getter methods. For all other fields, we only treat them as
    // persistable if we find valid getter and setter methods.
    try {
      PropertyMetadata propertyMetadata = new PropertyMetadata(field);
      return propertyMetadata;
    } catch (NoAccessorMethodException | NoMutatorMethodException exp) {
      if (property != null) {
        throw exp;
      }
    }
    return null;
  }
636946
public static ResolvableType forField(Field field) {
		Assert.notNull(field, "Field must not be null");
		return forType(null, new FieldTypeProvider(field), null);
	}
1338808
public void validateField(final I_CmsFormField field) {

        CmsValidationController validationController = new CmsValidationController(field, createValidationHandler());
        validationController.setFormValidator(m_validatorClass);
        validationController.setFormValidatorConfig(createValidatorConfig());
        startValidation(validationController);
    }