Examples of SizeConstraint


Examples of net.percederberg.mibble.type.SizeConstraint

        throws ParseException {

        Constraint  c;

        c = (Constraint) getValue(getChildAt(node, 1), 0);
        node.addValue(new SizeConstraint(getLocation(node), c));
        return node;
    }
View Full Code Here

Examples of org.grails.validation.SizeConstraint

     * @return Returns the size.
     */
    @Override
    @SuppressWarnings("rawtypes")
    public Range getSize() {
        SizeConstraint c = (SizeConstraint)appliedConstraints.get(SIZE_CONSTRAINT);
        return c == null ? null : c.getRange();
    }
View Full Code Here

Examples of org.grails.validation.SizeConstraint

        if (size == null) {
            appliedConstraints.remove(SIZE_CONSTRAINT);
        }
        else {
            if (c == null) {
                c = new SizeConstraint();
                c.setOwningClass(owningClass);
                c.setPropertyName(propertyName);
                appliedConstraints.put(SIZE_CONSTRAINT, c);
            }
            c.setParameter(size);
View Full Code Here

Examples of org.grails.validation.SizeConstraint

    @Override
    public Integer getMaxSize() {
        Integer maxSize = null;

        MaxSizeConstraint maxSizeConstraint = (MaxSizeConstraint)appliedConstraints.get(MAX_SIZE_CONSTRAINT);
        SizeConstraint sizeConstraint = (SizeConstraint)appliedConstraints.get(SIZE_CONSTRAINT);

        if (maxSizeConstraint != null || sizeConstraint != null) {
            int maxSizeConstraintValue = maxSizeConstraint == null ? Integer.MAX_VALUE : maxSizeConstraint.getMaxSize();
            int sizeConstraintHighValue = sizeConstraint == null ? Integer.MAX_VALUE : sizeConstraint.getRange().getToInt();
            maxSize = Math.min(maxSizeConstraintValue, sizeConstraintHighValue);
        }

        return maxSize;
    }
View Full Code Here

Examples of org.grails.validation.SizeConstraint

    @Override
    public Integer getMinSize() {
        Integer minSize = null;

        MinSizeConstraint minSizeConstraint = (MinSizeConstraint)appliedConstraints.get(MIN_SIZE_CONSTRAINT);
        SizeConstraint sizeConstraint = (SizeConstraint)appliedConstraints.get(SIZE_CONSTRAINT);

        if (minSizeConstraint != null || sizeConstraint != null) {
            int minSizeConstraintValue = minSizeConstraint == null ? Integer.MIN_VALUE : minSizeConstraint.getMinSize();
            int sizeConstraintLowValue = sizeConstraint == null ? Integer.MIN_VALUE : sizeConstraint.getRange().getFromInt();

            minSize = Math.max(minSizeConstraintValue, sizeConstraintLowValue);
        }

        return minSize;
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.