亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fieldchecks.java

?? struts的源代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
        if (result == null) {
            errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
        }

        return result == null ? Boolean.FALSE : result;
    }


    /**
     * Checks if the field can safely be converted to an int primitive.
     *
     * @param  bean     The bean validation is being performed on.
     * @param  va       The <code>ValidatorAction</code> that is currently being performed.
     * @param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     * @param  errors   The <code>ActionMessages</code> object to add errors to if any
     *      validation errors occur.
     * @param validator The <code>Validator</code> instance, used to access
     * other field values.
     * @param  request  Current request object.
     * @return true if valid, false otherwise.
     */
    public static Object validateInteger(Object bean,
                                          ValidatorAction va, Field field,
                                          ActionMessages errors,
                                          Validator validator,
                                          HttpServletRequest request) {
        Object result = null;
        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean, field.getProperty());
        }

        if (GenericValidator.isBlankOrNull(value)) {
            return Boolean.TRUE;
        }

        result = GenericTypeValidator.formatInt(value);

        if (result == null) {
            errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
        }

        return result == null ? Boolean.FALSE : result;
    }


    /**
     * Checks if the field can safely be converted to a long primitive.
     *
     * @param  bean     The bean validation is being performed on.
     * @param  va       The <code>ValidatorAction</code> that is currently being performed.
     * @param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     * @param  errors   The <code>ActionMessages</code> object to add errors to if any
     *      validation errors occur.
     * @param validator The <code>Validator</code> instance, used to access
     * other field values.
     * @param  request  Current request object.
     * @return true if valid, false otherwise.
     */
    public static Object validateLong(Object bean,
                                    ValidatorAction va, Field field,
                                    ActionMessages errors,
                                    Validator validator,
                                    HttpServletRequest request) {
        Object result = null;
        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean, field.getProperty());
        }

        if (GenericValidator.isBlankOrNull(value)) {
            return Boolean.TRUE;
        }

        result = GenericTypeValidator.formatLong(value);

        if (result == null) {
            errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
        }

        return result == null ? Boolean.FALSE : result;
    }


    /**
     * Checks if the field can safely be converted to a float primitive.
     *
     * @param  bean     The bean validation is being performed on.
     * @param  va       The <code>ValidatorAction</code> that is currently being performed.
     * @param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     * @param  errors   The <code>ActionMessages</code> object to add errors to if any
     *      validation errors occur.
     * @param validator The <code>Validator</code> instance, used to access
     * other field values.
     * @param  request  Current request object.
     * @return true if valid, false otherwise.
     */
    public static Object validateFloat(Object bean,
                                      ValidatorAction va, Field field,
                                      ActionMessages errors,
                                      Validator validator,
                                      HttpServletRequest request) {
        Object result = null;
        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean, field.getProperty());
        }

        if (GenericValidator.isBlankOrNull(value)) {
            return Boolean.TRUE;
        }

        result = GenericTypeValidator.formatFloat(value);

        if (result == null) {
            errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
        }

        return result == null ? Boolean.FALSE : result;
    }


    /**
     *  Checks if the field can safely be converted to a double primitive.
     *
     * @param  bean     The bean validation is being performed on.
     * @param  va       The <code>ValidatorAction</code> that is currently being performed.
     * @param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     * @param  errors   The <code>ActionMessages</code> object to add errors to if any
     *      validation errors occur.
     * @param validator The <code>Validator</code> instance, used to access
     * other field values.
     * @param  request  Current request object.
     * @return true if valid, false otherwise.
     */
    public static Object validateDouble(Object bean,
                                        ValidatorAction va, Field field,
                                        ActionMessages errors,
                                        Validator validator,
                                        HttpServletRequest request) {
        Object result = null;
        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean, field.getProperty());
        }

        if (GenericValidator.isBlankOrNull(value)) {
            return Boolean.TRUE;
        }

        result = GenericTypeValidator.formatDouble(value);

        if (result == null) {
            errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
        }

        return result == null ? Boolean.FALSE : result;
    }


    /**
     *  Checks if the field is a valid date. If the field has a datePattern variable,
     *  that will be used to format <code>java.text.SimpleDateFormat</code>. If the
     *  field has a datePatternStrict variable, that will be used to format <code>java.text.SimpleDateFormat</code>
     *  and the length will be checked so '2/12/1999' will not pass validation with
     *  the format 'MM/dd/yyyy' because the month isn't two digits. If no datePattern
     *  variable is specified, then the field gets the DateFormat.SHORT format for
     *  the locale. The setLenient method is set to <code>false</code> for all variations.
     *
     * @param  bean     The bean validation is being performed on.
     * @param  va       The <code>ValidatorAction</code> that is currently being performed.
     * @param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     * @param  errors   The <code>ActionMessages</code> object to add errors to if any
     *      validation errors occur.
     * @param validator The <code>Validator</code> instance, used to access
     * other field values.
     * @param  request  Current request object.
     * @return true if valid, false otherwise.
     */
    public static Object validateDate(Object bean,
                                    ValidatorAction va, Field field,
                                    ActionMessages errors,
                                    Validator validator,
                                    HttpServletRequest request) {

        Object result = null;
        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean, field.getProperty());
        }
        String datePattern = field.getVarValue("datePattern");
        String datePatternStrict = field.getVarValue("datePatternStrict");
        Locale locale = RequestUtils.getUserLocale(request, null);

        if (GenericValidator.isBlankOrNull(value)) {
            return Boolean.TRUE;
        }

        try {
            if (datePattern != null && datePattern.length() > 0) {
                result = GenericTypeValidator.formatDate(value, datePattern, false);
            } else if (datePatternStrict != null && datePatternStrict.length() > 0) {
                result = GenericTypeValidator.formatDate(value, datePatternStrict, true);
            } else {
                result = GenericTypeValidator.formatDate(value, locale);
            }
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        if (result == null) {
            errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
        }

        return result == null ? Boolean.FALSE : result;
    }

    /**
     * Checks if a fields value is within a range (min &amp; max specified in the
     * vars attribute).
     *
     * @param  bean     The bean validation is being performed on.
     * @param  va       The <code>ValidatorAction</code> that is currently being performed.
     * @param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     * @param  errors   The <code>ActionMessages</code> object to add errors to if any
     *      validation errors occur.
     * @param validator The <code>Validator</code> instance, used to access
     * other field values.
     * @param  request  Current request object.
     * @return True if in range, false otherwise.
     */
    public static boolean validateIntRange(Object bean,
                                           ValidatorAction va, Field field,
                                           ActionMessages errors,
                                           Validator validator,
                                           HttpServletRequest request) {

        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean, field.getProperty());
        }

        if (!GenericValidator.isBlankOrNull(value)) {
            try {
                int intValue = Integer.parseInt(value);
                int min = Integer.parseInt(field.getVarValue("min"));
                int max = Integer.parseInt(field.getVarValue("max"));

                if (!GenericValidator.isInRange(intValue, min, max)) {
                    errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));

                    return false;
                }
            } catch (Exception e) {
                errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
                return false;
            }
        }

        return true;
    }

    /**
     *  Checks if a fields value is within a range (min &amp; max specified in the
     *  vars attribute).
     *
     * @param  bean     The bean validation is being performed on.
     * @param  va       The <code>ValidatorAction</code> that is currently being performed.
     * @param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     * @param  errors   The <code>ActionMessages</code> object to add errors to if any
     *      validation errors occur.
     * @param validator The <code>Validator</code> instance, used to access
     * other field values.
     * @param  request  Current request object.
     * @return          True if in range, false otherwise.
     */
    public static boolean validateDoubleRange(Object bean,
                                              ValidatorAction va, Field field,
                                              ActionMessages errors,
                                              Validator validator,
                                              HttpServletRequest request) {

        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean, field.getProperty());
        }

        if (!GenericValidator.isBlankOrNull(value)) {
            try {
                double doubleValue = Double.parseDouble(value);
                double min = Double.parseDouble(field.getVarValue("min"));
                double max = Double.parseDouble(field.getVarValue("max"));

                if (!GenericValidator.isInRange(doubleValue, min, max)) {
                    errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));

                    return false;
                }
            } catch (Exception e) {
                errors.add(field.getKey(), Resources.getActionMessage(validator, request, va, field));
                return false;
            }
        }

        return true;
    }

    /**
     *  Checks if a fields value is within a range (min &amp; max specified in the

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区免费大片 | 欧美日韩一区视频| 日本一不卡视频| 国产精品毛片无遮挡高清| 精品视频一区三区九区| 国产寡妇亲子伦一区二区| 亚洲一区二区三区小说| 国产亚洲自拍一区| 欧美一区二区三区视频免费| 91视频免费播放| 国产精品自拍毛片| 免费视频最近日韩| 一区二区三区在线视频免费 | 在线欧美小视频| 国产精品一二三在| 免费视频一区二区| 亚洲国产综合91精品麻豆| 国产精品欧美一区二区三区| 久久久一区二区三区捆绑**| 欧美高清hd18日本| 91成人免费电影| 99r国产精品| 成人av影视在线观看| 国产在线精品一区二区三区不卡| 午夜久久久久久久久久一区二区| 椎名由奈av一区二区三区| 国产人久久人人人人爽| 精品国产伦一区二区三区免费 | 精品一区二区影视| 天天操天天综合网| 亚洲自拍偷拍欧美| 亚洲伦在线观看| 日本一区二区三区四区在线视频| 日韩精品一区二区三区视频播放| 欧美在线你懂得| av在线播放成人| 成人黄色av电影| 极品瑜伽女神91| 久久国产剧场电影| 日韩不卡手机在线v区| 亚洲成av人片在线观看| 亚洲欧洲精品天堂一级| 日韩理论片在线| 国产精品系列在线| 国产精品色一区二区三区| 久久精品视频在线看| 国产午夜精品一区二区| 久久这里只有精品视频网| 91黄视频在线观看| 91在线观看成人| 国产中文字幕精品| 国产精品亚洲人在线观看| 久久99精品一区二区三区三区| 久久99久久久欧美国产| 蜜乳av一区二区| 精品一区二区三区免费观看| 久久超碰97中文字幕| 国产精品中文字幕欧美| 国产盗摄一区二区| 91女厕偷拍女厕偷拍高清| 99re亚洲国产精品| 欧美色涩在线第一页| 欧美日韩视频专区在线播放| 日韩欧美电影一区| 国产精品久久毛片| 亚洲天堂2016| 亚洲综合色在线| 免费观看一级欧美片| 国内精品国产成人国产三级粉色| 高清在线观看日韩| 9久草视频在线视频精品| 欧美性做爰猛烈叫床潮| 欧美日韩第一区日日骚| 欧美变态tickling挠脚心| 国产欧美一区二区在线观看| 欧美激情一区二区在线| 亚洲色图另类专区| 樱桃视频在线观看一区| 美女视频黄频大全不卡视频在线播放| 丝袜美腿一区二区三区| 精品在线一区二区三区| 成人一区二区在线观看| 色视频欧美一区二区三区| 欧美日韩一二三| 国产亚洲欧美一区在线观看| 中文字幕一区二区三区不卡在线 | 1024精品合集| 性欧美疯狂xxxxbbbb| 久久电影国产免费久久电影| 色天天综合久久久久综合片| 欧美一区二区三区在线| 国产精品免费丝袜| 亚洲大片精品永久免费| 国产成人av福利| 欧美综合在线视频| 久久精品日产第一区二区三区高清版| 亚洲人成在线观看一区二区| 久久www免费人成看片高清| av一区二区三区在线| 精品国产一区二区精华| 亚洲另类在线视频| 国产麻豆一精品一av一免费| 在线免费一区三区| 欧美国产精品劲爆| 日韩精品欧美精品| 色国产综合视频| 久久久久久99久久久精品网站| 五月天精品一区二区三区| 成人在线一区二区三区| 日韩精品资源二区在线| 亚洲免费观看在线视频| 粉嫩av亚洲一区二区图片| 欧美日韩久久久| 亚洲精品一二三区| 国产一区不卡在线| 91精品国产91久久久久久最新毛片| 中文字幕av一区 二区| 成人性生交大片免费看视频在线 | 亚洲男女一区二区三区| 国产伦精品一区二区三区免费迷 | 国产毛片精品视频| 欧美色图12p| 亚洲h在线观看| 欧美成人一区二区| 色哟哟一区二区| 精油按摩中文字幕久久| 99久久精品国产观看| 成人福利视频在线看| 亚洲欧美影音先锋| 成人妖精视频yjsp地址| 亚洲18影院在线观看| 国产成人免费视频网站高清观看视频| 日韩免费高清电影| 国产喷白浆一区二区三区| 国产大片一区二区| 欧美一级免费大片| 日本欧美久久久久免费播放网| 国产91精品一区二区麻豆亚洲| 欧美一区二区三区在线电影| 三级精品在线观看| 风间由美一区二区av101 | 国产精品视频yy9299一区| 国产成人亚洲综合色影视| 精品国产露脸精彩对白| 国产在线看一区| ww亚洲ww在线观看国产| 国产盗摄一区二区| 中文字幕av一区二区三区高| 成+人+亚洲+综合天堂| 国产精品久久久久一区| 99久久免费精品| 国产女同互慰高潮91漫画| 不卡高清视频专区| 日韩中文字幕一区二区三区| 欧美性做爰猛烈叫床潮| 免费一区二区视频| 精品国产髙清在线看国产毛片| 精品一区二区三区在线观看国产| 精品捆绑美女sm三区| 成人性生交大片免费看在线播放| 国产精品人成在线观看免费| 色偷偷88欧美精品久久久| 亚洲综合免费观看高清完整版 | 精品中文av资源站在线观看| 国产色爱av资源综合区| 国产寡妇亲子伦一区二区| 亚洲欧美日韩综合aⅴ视频| 91福利国产成人精品照片| 日产国产欧美视频一区精品| 欧美一级生活片| 丁香网亚洲国际| 亚洲精品中文在线观看| 777奇米成人网| 久久精品国产在热久久| 国产精品久久久久久一区二区三区 | 日韩精品一区二区三区在线| 国产福利一区二区三区| 亚洲视频图片小说| 欧美日韩视频不卡| 蜜臀av一区二区三区| 国产午夜亚洲精品午夜鲁丝片| 成人毛片在线观看| 偷窥少妇高潮呻吟av久久免费| 欧美情侣在线播放| 粉嫩aⅴ一区二区三区四区五区| 中文字幕在线免费不卡| 欧美午夜精品久久久久久孕妇| 国产精品一区二区久激情瑜伽| 国产精品美女久久久久久| 欧美肥妇毛茸茸| 国产成人av一区二区三区在线观看| 午夜精品久久久久久久| 2024国产精品| 欧美日韩中文国产| 国产精品456| 日本欧美加勒比视频| 国产精品美女久久久久aⅴ国产馆| 制服丝袜激情欧洲亚洲| 91免费版在线| 精品制服美女久久|