⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strutsvalidator.java

📁 这是一个轻便的j2ee的web应用框架,是一个在多个项目中运用的实际框架,采用struts,hebinate,xml等技术,有丰富的tag,role,navigation,session,dictio
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     *@param  field    The <code>Field</code> object associated with the current
     *      field being validated.
     *@param  errors   The <code>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          A Long if valid, a null otherwise.
     */
    public static Long validateLong(Object bean,
                                    ValidatorAction va, Field field,
                                    ActionErrors errors,
                                    HttpServletRequest request) {
        return org.apache.struts.validator.FieldChecks.validateLong(bean,va,field,errors,request);
    }


    /**
     *  <p>
     *
     *  Checks if the field can safely be converted to a float primitive.</p>
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateFloat(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          A Float if valid, a null otherwise.
     */
    public static Float validateFloat(Object bean,
                                      ValidatorAction va, Field field,
                                      ActionErrors errors,
                                      HttpServletRequest request) {
       return org.apache.struts.validator.FieldChecks.validateFloat(bean,va,field,errors,request);
    }


    /**
     *  <p>
     *
     *  Checks if the field can safely be converted to a double primitive.</p>
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateDouble(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          A Double if valid, a null otherwise.
     */
    public static Double validateDouble(Object bean,
                                        ValidatorAction va, Field field,
                                        ActionErrors errors,
                                        HttpServletRequest request) {
       return org.apache.struts.validator.FieldChecks.validateDouble(bean,va,field,errors,request);
    }


    /**
     *  <p>
     *
     *  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.
     *  </p>
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateDate(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          A Date if valid, a null if blank or invalid.
     */
    public static Date validateDate(Object bean,
                                    ValidatorAction va, Field field,
                                    ActionErrors errors,
                                    HttpServletRequest request) {

       return org.apache.struts.validator.FieldChecks.validateDate(bean,va,field,errors,request);
    }

    /**
     *  <p>
     *
     *  Checks if a fields value is within a range (min &amp; max specified in the
     *  vars attribute).</p>
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateIntRange(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          True if in range, false otherwise.
     */
    public static boolean validateRange(Object bean,
                                        ValidatorAction va, Field field,
                                        ActionErrors errors,
                                        HttpServletRequest request) {
        return org.apache.struts.validator.FieldChecks.validateIntRange(bean, va, field, errors, request);
    }


    /**
     *  <p>
     *
     *  Checks if the field is a valid credit card number.</p> <p>
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateCreditCard(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *
     *  Translated to Java by Ted Husted (<a href="mailto:husted@apache.org">husted@apache.org
     *  </a>).<br>
     *  &nbsp;&nbsp;&nbsp; Reference Sean M. Burke's script at http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
     *  </p>
     *
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          The credit card as a Long, a null if invalid, blank, or null.
     */
    public static Long validateCreditCard(Object bean,
                                          ValidatorAction va, Field field,
                                          ActionErrors errors,
                                          HttpServletRequest request) {

       return org.apache.struts.validator.FieldChecks.validateCreditCard(bean,va,field,errors,request);
    }


    /**
     *  <p>
     *
     *  Checks if a field has a valid e-mail address.</p> <p>
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateEmail(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *
     *  Based on a script by Sandeep V. Tamhankar (stamhankar@hotmail.com), http://javascript.internet.com
     *  </p>
     *
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          True if valid, false otherwise.
     */
    public static boolean validateEmail(Object bean,
                                        ValidatorAction va, Field field,
                                        ActionErrors errors,
                                        HttpServletRequest request) {

       return org.apache.struts.validator.FieldChecks.validateEmail(bean,va,field,errors,request);
    }


    /**
     *  <p>
     *
     *  Checks if the field's length is less than or equal to the maximum value.
     *  A <code>Null</code> will be considered an error.</p>
     *
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateMaxLength(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          True if stated conditions met.
     */
    public static boolean validateMaxLength(Object bean,
                                            ValidatorAction va, Field field,
                                            ActionErrors errors,
                                            HttpServletRequest request) {

       return org.apache.struts.validator.FieldChecks.validateMaxLength(bean,va,field,errors,request);
    }


    /**
     *  <p>
     *
     *  Checks if the field's length is greater than or equal to the minimum value.
     *  A <code>Null</code> will be considered an error.</p>
     *
     *@deprecated  As of Struts 1.1, replaced by {@link org.apache.struts.validator.FieldChecks#validateMinLength(Object,ValidatorAction,Field,ActionErrors,HttpServletRequest)}
     *@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>ActionErrors</code> object to add errors to if any
     *      validation errors occur.
     *@param  request  Current request object.
     *@return          True if stated conditions met.
     */
    public static boolean validateMinLength(Object bean,
                                            ValidatorAction va, Field field,
                                            ActionErrors errors,
                                            HttpServletRequest request) {

        return org.apache.struts.validator.FieldChecks.validateMinLength(bean,va,field,errors,request);
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -