Package org.haystack

Examples of org.haystack.ValidationMessage


    @Override
    protected List<ValidationMessage> validate(List<ValidationMessage> messages) {
        messages = super.validate(messages);

        if (mime == null || mime.length() == 0)
            messages = addValidationMessage(messages, new ValidationMessage("mime", "haystack.required"));
        else if (mime.indexOf('/') < 0)
            messages = addValidationMessage(messages, new ValidationMessage("mime", "haystack.invalidValue"));
        else {
            for (int i = 0; i < mime.length(); ++i) {
                int c = mime.charAt(i);
                if (c > 127 || c == ')') {
                    messages = addValidationMessage(messages, new ValidationMessage("mime", "haystack.invalidChar",
                            new Object[] { new Character((char) c) }));
                    break;
                }
            }
        }
View Full Code Here


    @Override
    protected List<ValidationMessage> validate(List<ValidationMessage> messages) {
        messages = super.validate(messages);

        if (date == null)
            messages = addValidationMessage(messages, new ValidationMessage("date", "haystack.required"));
        if (time == null)
            messages = addValidationMessage(messages, new ValidationMessage("time", "haystack.required"));
        if (tz == null)
            messages = addValidationMessage(messages, new ValidationMessage("tz", "haystack.required"));

        return messages;
    }
View Full Code Here

    @Override
    protected List<ValidationMessage> validate(List<ValidationMessage> messages) {
        messages = super.validate(messages);

        if (hour < 0 || hour > 23)
            messages = addValidationMessage(messages, new ValidationMessage("hour", "haystack.invalidValue"));
        if (min < 0 || min > 59)
            messages = addValidationMessage(messages, new ValidationMessage("min", "haystack.invalidValue"));
        if (sec < 0 || sec > 59)
            messages = addValidationMessage(messages, new ValidationMessage("sec", "haystack.invalidValue"));
        if (ms < 0 || ms > 999)
            messages = addValidationMessage(messages, new ValidationMessage("ms", "haystack.invalidValue"));

        return messages;
    }
View Full Code Here

        if (unit != null) {
            for (int i = 0; i < unit.length(); ++i) {
                int c = unit.charAt(i);
                if (c < 128 && !unitChars[c]) {
                    messages = addValidationMessage(messages, new ValidationMessage("unit", "haystack.invalidChar",
                            new Object[] { new Character((char) c) }));
                    break;
                }
            }
        }
View Full Code Here

    @Override
    protected List<ValidationMessage> validate(List<ValidationMessage> messages) {
        messages = super.validate(messages);

        if (val == null || val.length() == 0)
            messages = addValidationMessage(messages, new ValidationMessage("val", "haystack.invalidValue"));

        for (int i = 0; i < val.length(); ++i) {
            int c = val.charAt(i);
            if (!isIdChar(c)) {
                messages = addValidationMessage(messages, new ValidationMessage("val", "haystack.invalidChar",
                        new Object[] { new Character((char) c) }));
                break;
            }
        }
View Full Code Here

    @Override
    protected List<ValidationMessage> validate(List<ValidationMessage> messages) {
        messages = super.validate(messages);

        if (ulat < -90000000 || ulat > 90000000)
            messages = addValidationMessage(messages, new ValidationMessage("lat", "haystack.invalidValue"));
        if (ulng < -180000000 || ulng > 180000000)
            messages = addValidationMessage(messages, new ValidationMessage("lng", "haystack.invalidValue"));

        return messages;
    }
View Full Code Here

        messages = super.validate(messages);

        for (int i = 0; i < val.length(); ++i) {
            int c = val.charAt(i);
            if (c < ' ') {
                messages = addValidationMessage(messages, new ValidationMessage("val", "haystack.invalidChar",
                        new Object[] { new Character((char) c) }));
                break;
            }
        }
View Full Code Here

    @Override
    protected List<ValidationMessage> validate(List<ValidationMessage> messages) {
        messages = super.validate(messages);

        if (year < 1900)
            messages = addValidationMessage(messages, new ValidationMessage("year", "haystack.invalidValue"));
        if (month < 1 || month > 12)
            messages = addValidationMessage(messages, new ValidationMessage("month", "haystack.invalidValue"));
        if (day < 1 || day > 31)
            messages = addValidationMessage(messages, new ValidationMessage("day", "haystack.invalidValue"));

        return messages;
    }
View Full Code Here

TOP

Related Classes of org.haystack.ValidationMessage

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.