Package com.jgoodies.validation.util

Examples of com.jgoodies.validation.util.PropertyValidationSupport


    /**
     * @see com.jgoodies.validation.Validator#validate()
     */
    public final ValidationResult validate() {
        PropertyValidationSupport support = new PropertyValidationSupport(
                procentDoneModel, "Prosent ferdig");
       
        if (!ValidationUtils.isAlphanumeric(ModelUtil.nullToString(procentDoneModel
                .getProcentString()))) {
            support.addError("prosent", "m� v�re tall");
        }

        if (ValidationUtils.isBlank(ModelUtil.nullToString(procentDoneModel
                .getProcentString()))) {
            support.addError("prosent", "m� settes");
        }
       
        if(procentDoneModel.getProcent()!=null&&procentDoneModel.getProcent()>100){
            support.addError("prosent", "kan ikke v�re st�rre enn 100");
        }

        return support.getResult();
    }
View Full Code Here


     * Validates this Validator's Order and returns the result as an instance of
     * {@link ValidationResult}.
     * @return the ValidationResult of the order validation
     */
    public final ValidationResult validate() {
        PropertyValidationSupport support = new PropertyValidationSupport(
                transportModel, "Transport");

        if (ValidationUtils.isBlank(ModelUtil.nullToString(transportModel
                .getTransportYear()))) {
            support.addError("�r", "m� settes");
        }

        if (ValidationUtils.isBlank(ModelUtil.nullToString(transportModel
                .getTransportWeek()))) {
            support.addError("uke", "m� settes");
        }

        if (ValidationUtils.isBlank(ModelUtil.nullToString(transportModel
                .getTransportName()))) {
            support.addError("navn", "m� settes");
        }

        return support.getResult();
    }
View Full Code Here

     * Validates this Validator's Order and returns the result as an instance of
     * {@link ValidationResult}.
     * @return the ValidationResult of the order validation
     */
    public final ValidationResult validate() {
        PropertyValidationSupport support = new PropertyValidationSupport(
                employeeModel, "Ansatt");

        if (ValidationUtils.isBlank(ModelUtil.nullToString(employeeModel
                .getFirstName()))) {
            support.addError("fornavn", "m� settes");
        }
        if (ValidationUtils.isBlank(ModelUtil.nullToString(employeeModel
                .getLastName()))) {
            support.addError("etternavn", "m� settes");
        }

        if (employeeModel.getEmployeeType() == null) {
            support.addWarning("type", "b�r registreres");
        }

        return support.getResult();
    }
View Full Code Here

     * Validates this Validator's Order and returns the result as an instance of
     * {@link ValidationResult}.
     * @return the ValidationResult of the order validation
     */
    public final ValidationResult validate() {
        PropertyValidationSupport support = new PropertyValidationSupport(
                functionCategoryModel, "Kategori");

        if (ValidationUtils.isBlank(ModelUtil
                .nullToString(functionCategoryModel.getFunctionCategoryName()))) {
            support.addError("navn", "m� settes");
        }

        if (functionCategoryModel.getJobFunction() == null) {
            support.addError("funksjon", "m� settes");
        }

        return support.getResult();
    }
View Full Code Here

    /**
     * @see com.jgoodies.validation.Validator#validate()
     */
    public final ValidationResult validate() {
        PropertyValidationSupport support = new PropertyValidationSupport(
                accidentModel, "Ulykke");

       
       
        if (ValidationUtils.isBlank(ModelUtil.nullToString(accidentModel
                .getRegisteredBy()))) {
            support.addError("registert av", "m� settes");
        }
       
        if (accidentModel.getRegistrationDate()==null) {
            support.addError("registreringsdato", "m� settes");
        }
       
        if (accidentModel.getJobFunction()==null) {
            support.addError("funksjon", "m� settes");
        }
       
        if (accidentModel.getPersonalInjury()==null) {
            support.addError("type", "m� settes");
        }
       
        if (accidentModel.getAccidentDate()==null) {
            support.addError("ulykkesdato", "m� settes");
        }
       
        if (ValidationUtils.isBlank(ModelUtil.nullToString(accidentModel
                .getAccidentDescription()))) {
            support.addError("beskrivelse", "m� settes");
        }
       
        if (ValidationUtils.isBlank(ModelUtil.nullToString(accidentModel
                .getAccidentCause()))) {
            support.addError("�rsak", "m� settes");
        }

        return support.getResult();
    }
View Full Code Here

     * Validates this Validator's Order and returns the result as an instance of
     * {@link ValidationResult}.
     * @return the ValidationResult of the order validation
     */
    public final ValidationResult validate() {
        PropertyValidationSupport support = new PropertyValidationSupport(
                customerModel, "Kunde");

        if (ValidationUtils.isBlank(ModelUtil.nullToString(customerModel
                .getCustomerNr()))) {
            support.addError("nummer", "m� settes");
        }

        if (ValidationUtils.isBlank(customerModel.getFirstName())) {
            support.addError("fornavn", "m� settes");
        }

        if (ValidationUtils.isBlank(customerModel.getLastName())) {
            support.addError("etternavn", "m� settes");
        }

        return support.getResult();
    }
View Full Code Here

TOP

Related Classes of com.jgoodies.validation.util.PropertyValidationSupport

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.