Package org.crank.validation.validators

Examples of org.crank.validation.validators.CompositeValidator


        /*
         * A field (property) can be associated with many validators so we use a
         * CompositeValidator to hold all of the validators associated with this
         * validator.
         */
        CompositeValidator compositeValidator = new CompositeValidator(); // hold
                                                                            // all
                                                                            // of
                                                                            // the
                                                                            // validators
                                                                            // associated
                                                                            // with
                                                                            // the
                                                                            // field.

        /*
         * Lookup the list of validators for the current field and initialize
         * them with validation meta-data properties.
         */
        List<FieldValidator> validatorsList =
            lookupTheListOfValidatorsAndInitializeThemWithMetaDataProperties(validationMetaDataList);

        compositeValidator.setValidatorList(validatorsList);

        return compositeValidator;
    }
View Full Code Here


    private void validateProperty(final Object object, final Object objectProperty, final String property,
            List <MessageHolder> vMessageHolders) {

        List<ValidatorMetaData> metaDataList = readMetaData(object.getClass(),
                property);
        CompositeValidator cv = createValidator(metaDataList);
        ValidatorMessageHolder holder = cv.validate(objectProperty, property);
        vMessageHolders.add(new MessageHolder(ValidationContext.getBindingPath(), holder));
    }
View Full Code Here

    fieldNameHolder[0] = validatorData.getPropertyNameOfTheField();

    /* Read the metaDataList for this property of this parent object. */
    List<ValidatorMetaData> metaDataList = readMetaData(validatorData
        .getParentClassOfTheField(), validatorData.getPropertyNameOfTheField());
    CompositeValidator cv = createValidator(metaDataList);
    return cv;
  }
View Full Code Here

    /*
     * A field (property) can be associated with many validators so we use a
     * CompositeValidator to hold all of the validators associated with this
     * validator.
     */
    CompositeValidator compositeValidator = new CompositeValidator(); // hold
                                      // all
                                      // of
                                      // the
                                      // validators
                                      // associated
                                      // with
                                      // the
                                      // field.

    /*
     * Lookup the list of validators for the current field and initialize
     * them with validation meta-data properties.
     */
    List<FieldValidator> validatorsList =
      lookupTheListOfValidatorsAndInitializeThemWithMetaDataProperties(validationMetaDataList);

    compositeValidator.setValidatorList( validatorsList);

    return compositeValidator;
  }
View Full Code Here

TOP

Related Classes of org.crank.validation.validators.CompositeValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.