Package org.criticalfailure.torchlight.core.domain.validator

Examples of org.criticalfailure.torchlight.core.domain.validator.ObjectPropertyValidationResult


                    String v = StringUtils.stripToEmpty(value.toString());
                    logger.trace("v: " + v);

                    try {
                        logger.debug("calling validator for object data: " + obj + "; value: " + v);
                        ObjectPropertyValidationResult result = validationHelper.validate(objectInstance,
                                (ObjectData)obj, v);
                        logger.trace("result: " + result);
                        if(result.isValid()) {
                            logger.debug("value is valid; set in object data");
                            ((ObjectData)obj).setValue(v);

                            objectInstance.save();
                        }

                        dataNotes.put((ObjectData)obj, result.getCode() + ":" + result.getMessage());
                    }
                    catch(Exception e) {
                        logger.error("Exception caught while executing validator: " + e.getLocalizedMessage(), e);

                        dataNotes.put((ObjectData)obj, e.getLocalizedMessage());
View Full Code Here


                IObjectPropertyValidator validator = objectPropertyValidatorListener.getValidator(validatorType);
                logger.trace("validator: " + validator);

                if(validator != null) {
                    logger.debug("invoking validator: " + validator);
                    ObjectPropertyValidationResult result = new ObjectPropertyValidationResult();
                    validator.validate(op, proposedValue, result);

                    return result;
                }
            }
        }

        return new ObjectPropertyValidationResult();
    }
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.domain.validator.ObjectPropertyValidationResult

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.