Package net.mindengine.galen.validation

Examples of net.mindengine.galen.validation.ValidationErrorException


                messages.add(message);
            }
        }
       
        if (messages.size() > 0) {
          throw new ValidationErrorException()
                .withErrorArea(new ErrorArea(mainArea, objectName))
                .withErrorArea(new ErrorArea(secondArea, spec.getObject()))
                .withMessage(createMessage(messages, objectName));
        }
    }
View Full Code Here


        PageElement childObject = pageValidation.findPageElement(spec.getObject());
        checkAvailability(childObject, spec.getObject());
       
        int offset = Math.abs(getOffset(spec, mainObject, childObject));
        if (offset > Math.abs(spec.getErrorRate())) {
            throw new ValidationErrorException(Arrays.asList(new ErrorArea(mainObject.getArea(), objectName), new ErrorArea(childObject.getArea(), spec.getObject())),
                    Arrays.asList(errorMisalignedObjects(objectName, spec.getObject(), spec, offset)));
        }
    }
View Full Code Here

                new PageValidation(pageValidation.getBrowser(), objectContextPage, componentPageSpec, validationListener, pageValidation.getSectionFilter()),
                validationListener);
       
        List<ValidationError> errors = sectionValidation.check();
        if (errors != null && errors.size() > 0) {
            throw new ValidationErrorException("Child component spec contains " + errors.size() + " errors");
        }
    }
View Full Code Here

    }

    private void checkCentered(int offsetA, int offsetB, String objectName, SpecCentered spec, String location, String alignment) throws ValidationErrorException {
        int offset = Math.abs(offsetA - offsetB);
        if (offset > spec.getErrorRate()) {
            throw new ValidationErrorException(String.format("\"%s\" is not centered %s %s \"%s\". Offset is %dpx", objectName, alignment, location, spec.getObject(), offset));
        }
       
        if (offsetA < 0 || offsetB < 0){
            throw new ValidationErrorException(String.format("\"%s\" is centered but not %s %s \"%s\"", objectName, alignment, location, spec.getObject(), offset));
        }
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.validation.ValidationErrorException

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.