Package com.volantis.mcs.model.validation

Examples of com.volantis.mcs.model.validation.Validator.validate()


        if (object != null && object instanceof Validatable) {
            ModelFactory modelFactory = ModelFactory.getDefaultInstance();
            Validator validator = modelFactory.createValidator();

            // Validate the object being created
            validator.validate((Validatable) object);

            // Validate the already created selectors
            List selectors = listBuilder.getItems();
            Iterator it = selectors.iterator();
            while (it.hasNext() && validator.getDiagnostics().isEmpty()) {
View Full Code Here


            // Validate the already created selectors
            List selectors = listBuilder.getItems();
            Iterator it = selectors.iterator();
            while (it.hasNext() && validator.getDiagnostics().isEmpty()) {
                validator.validate((Validatable) it.next());
            }

            // Retrieve the first error message
            List diagnostics = validator.getDiagnostics();
            if (!diagnostics.isEmpty()) {
View Full Code Here

    }

    public void validate(Validatable validatable) {
        Validator validator = ModelFactory.getDefaultInstance()
                .createValidator();
        validator.validate(validatable);

        if (pruning && validatable instanceof Pruneable) {
            ((Pruneable)validatable).prune(validator.getValidationContext(),
                    validator.getDiagnostics());
        }
View Full Code Here

        PREPARE_4_VALIDATION.prepare(proxy);

        // Validate the model.
        Validator validator = MODEL_FACTORY.createValidator();
        Validatable validatable = (Validatable) proxy.getModelObject();
        validator.validate(validatable);

        // Get the diagnostics and iterate over them associating them with
        // the relevant proxy.
        List diagnostics = validator.getDiagnostics();
        for (int i = 0; i < diagnostics.size(); i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.