📄 intrangefieldvalidator.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 --> * <validators> * <!-- Plain Validator Syntax --> * <validator type="int"> * <param name="fieldName">age</param> * <param name="min">20</param> * <param name="max">50</param> * <message>Age needs to be between ${min} and ${max}</message> * </validator> * * <!-- Field Validator Syntax --> * <field name="age"> * <field-validator type="int"> * <param name="min">20</param> * <param name="max">50</param> * <message>Age needs to be between ${min} and ${max}</message> * </field-validator> * </field> * </validators> * <!-- 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 + -