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

📄 intrangefieldvalidator.java

📁 在Struts2中的jar包xwork的源代码.版本为2.0.7
💻 JAVA
字号:
/* * Copyright (c) 2002-2006 by OpenSymphony * All rights reserved. */package com.opensymphony.xwork2.validator.validators;/** * <!-- START SNIPPET: javadoc --> * Field Validator that checks if the integer specified is within a certain range. * <!-- END SNIPPET: javadoc --> *  *  * <!-- START SNIPPET: parameters --> * <ul> * 		<li>fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required</li> * 		<li>min - the minimum value (if none is specified, it will not be checked) </li> * 		<li>max - the maximum value (if none is specified, it will not be checked) </li> * </ul> * <!-- END SNIPPET: parameters --> *  *  * <pre> * <!-- START SNIPPET: examples --> * 		&lt;validators> *           &lt;!-- Plain Validator Syntax --&gt; *           &lt;validator type="int"> *               &lt;param name="fieldName"&gt;age&lt;/param&gt; *               &lt;param name="min"&gt;20&lt;/param&gt; *               &lt;param name="max"&gt;50&lt;/param&gt; *               &lt;message&gt;Age needs to be between ${min} and ${max}&lt;/message&gt; *           &lt;/validator&gt; *            *           &lt;!-- Field Validator Syntax --&gt; *           &lt;field name="age"&gt; *               &lt;field-validator type="int"&gt; *                   &lt;param name="min"&gt;20&lt;/param&gt; *                   &lt;param name="max"&gt;50&lt;/param&gt; *                   &lt;message&gt;Age needs to be between ${min} and ${max}&lt;/message&gt; *               &lt;/field-validator&gt; *           &lt;/field&gt; *      &lt;/validators&gt; * <!-- END SNIPPET: examples --> * </pre> *  *  *  * @author Jason Carreira * @version $Date: 2006-07-10 02:30:29 +0200 (Mo, 10 Jul 2006) $ $Id: IntRangeFieldValidator.java 1063 2006-07-10 00:30:29Z mrdon $ */public class IntRangeFieldValidator extends AbstractRangeValidator {    Integer max = null;    Integer min = null;    public void setMax(Integer max) {        this.max = max;    }    public Integer getMax() {        return max;    }    public Comparable getMaxComparatorValue() {        return max;    }    public void setMin(Integer min) {        this.min = min;    }    public Integer getMin() {        return min;    }    public Comparable getMinComparatorValue() {        return min;    }}

⌨️ 快捷键说明

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