public class ValidationTools extends Object
Constructor and Description |
---|
ValidationTools() |
Modifier and Type | Method and Description |
---|---|
static String |
htmlFilter(String inputString)
过滤html代码
|
static boolean |
isChinese(String text)
匹配汉字
|
static boolean |
isChineseChar(String text)
判断中文字符(包括汉字和符号)
|
static boolean |
isContainsSpecialChar(String text)
是否包含中英文特殊字符,除英文"-_"字符外
|
static boolean |
isDigits(String str)
只能输入数字
|
static boolean |
isEmail(String str)
匹配Email地址
|
static boolean |
isEnglish(String text)
判断英文字符(a-zA-Z)
|
static boolean |
isFloat(String str)
匹配正浮点数
|
static boolean |
isFloatEqZero(float num)
判断浮点数num是否等于0
|
static boolean |
isFloatGteZero(float num)
判断浮点数num是否大于或等于0
|
static boolean |
isFloatGtZero(float num)
判断浮点数num是否大于0
|
static boolean |
isIdCardNo(String text)
身份证号码验证
|
static boolean |
isInteger(String str)
匹配非负整数(正整数+0)
|
static boolean |
isIntEqZero(int num)
判断整数num是否等于0
|
static boolean |
isIntGteZero(int num)
判断整数num是否大于或等于0
|
static boolean |
isIntGtZero(int num)
判断整数num是否大于0
|
static boolean |
isMobile(String text)
手机号码验证
|
static boolean |
isNotNull(Collection collection)
是否 不为 null
|
static boolean |
isNotNull(Integer integer)
是否 不为 null
|
static boolean |
isNotNull(Long longs)
是否 不为 null
|
static boolean |
isNotNull(Map map)
是否 不为 null
|
static boolean |
isNotNull(Object[] objs)
是否 不为 null
|
static boolean |
isNotNull(String str)
是否 不为 null
|
static boolean |
isNull(Collection collection)
是否为 null
|
static boolean |
isNull(Integer integer)
是否为 null
|
static boolean |
isNull(Long longs)
是否为 null
|
static boolean |
isNull(Map map)
是否为 null
|
static boolean |
isNull(Object[] objs)
是否为 null
|
static boolean |
isNull(String str)
是否为 null
|
static boolean |
isNumeric(String str)
判断数值类型,包括整数和浮点数
|
static boolean |
isPhone(String text)
电话号码验证
|
static boolean |
isPwd(String str)
匹配密码,以字母开头,长度在6-16之间,只能包含字符、数字和下划线。
|
static boolean |
isPwd(String str,
int min,
int max)
匹配密码,以字母开头,长度在min-max之间,只能包含字符、数字和下划线。
|
static boolean |
isRightfulString(String text)
判断是否为合法字符(a-zA-Z0-9-_)
|
static boolean |
isTel(String text)
联系电话(手机/电话皆可)验证
|
static boolean |
isUrl(String str)
匹配URL地址
|
static boolean |
isZipCode(String text)
邮政编码验证
|
static boolean |
stringCheck(String str)
验证字符,只能包含中文、英文、数字、下划线等字符。
|
static String |
stringFilter(String text)
过滤中英文特殊字符,除英文"-_"字符外
|
public static final boolean isNull(Object[] objs)
objs
- public static final boolean isNull(Integer integer)
integer
- public static final boolean isNull(Collection collection)
collection
- public static final boolean isNull(Map map)
map
- public static final boolean isNull(String str)
str
- public static final boolean isNull(Long longs)
longs
- public static final boolean isNotNull(Long longs)
longs
- public static final boolean isNotNull(String str)
str
- public static final boolean isNotNull(Collection collection)
collection
- public static final boolean isNotNull(Map map)
map
- public static final boolean isNotNull(Integer integer)
integer
- public static final boolean isNotNull(Object[] objs)
objs
- public static final boolean isUrl(String str)
str
- public static final boolean isPwd(String str)
str
- public static final boolean isPwd(String str, int min, int max)
str
- min
- 缺省 为 6max
- 缺省 为 16public static final boolean stringCheck(String str)
str
- public static final boolean isEmail(String str)
str
- public static final boolean isInteger(String str)
str
- public static final boolean isNumeric(String str)
str
- public static final boolean isDigits(String str)
str
- public static final boolean isFloat(String str)
str
- public static final boolean isTel(String text)
text
- public static final boolean isPhone(String text)
text
- public static final boolean isMobile(String text)
text
- public static final boolean isIdCardNo(String text)
text
- public static final boolean isZipCode(String text)
text
- public static final boolean isIntEqZero(int num)
num
- public static final boolean isIntGtZero(int num)
num
- public static final boolean isIntGteZero(int num)
num
- public static final boolean isFloatEqZero(float num)
num
- 浮点数public static final boolean isFloatGtZero(float num)
num
- 浮点数public static final boolean isFloatGteZero(float num)
num
- 浮点数public static final boolean isRightfulString(String text)
text
- public static final boolean isEnglish(String text)
text
- public static final boolean isChineseChar(String text)
text
- public static final boolean isChinese(String text)
text
- public static boolean isContainsSpecialChar(String text)
str
- public static String stringFilter(String text)
text
- Copyright © 2018. All rights reserved.