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

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

?? custombooleaneditor.java

?? spring framework 2.5.4源代碼
?? JAVA
字號:
/*
 * Copyright 2002-2007 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.beans.propertyeditors;

import java.beans.PropertyEditorSupport;

import org.springframework.util.StringUtils;

/**
 * Property editor for Boolean/boolean properties.
 *
 * <p>This is not meant to be used as system PropertyEditor but rather as
 * locale-specific Boolean editor within custom controller code, to parse
 * UI-caused boolean strings into boolean properties of beans and check
 * them in the UI form.
 *
 * <p>In web MVC code, this editor will typically be registered with
 * <code>binder.registerCustomEditor</code> calls in an implementation
 * of BaseCommandController's <code>initBinder</code> method.
 *
 * @author Juergen Hoeller
 * @since 10.06.2003
 * @see org.springframework.validation.DataBinder#registerCustomEditor
 * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder
 */
public class CustomBooleanEditor extends PropertyEditorSupport {

	public static final String VALUE_TRUE = "true";
	public static final String VALUE_FALSE = "false";

	public static final String VALUE_ON = "on";
	public static final String VALUE_OFF = "off";

	public static final String VALUE_YES = "yes";
	public static final String VALUE_NO = "no";

	public static final String VALUE_1 = "1";
	public static final String VALUE_0 = "0";


	private final String trueString;

	private final String falseString;

	private final boolean allowEmpty;


	/**
	 * Create a new CustomBooleanEditor instance, with "true"/"on"/"yes"
	 * and "false"/"off"/"no" as recognized String values.
	 * <p>The "allowEmpty" parameter states if an empty String should
	 * be allowed for parsing, i.e. get interpreted as null value.
	 * Else, an IllegalArgumentException gets thrown in that case.
	 * @param allowEmpty if empty strings should be allowed
	 */
	public CustomBooleanEditor(boolean allowEmpty) {
		this(null, null, allowEmpty);
	}

	/**
	 * Create a new CustomBooleanEditor instance,
	 * with configurable String values for true and false.
	 * <p>The "allowEmpty" parameter states if an empty String should
	 * be allowed for parsing, i.e. get interpreted as null value.
	 * Else, an IllegalArgumentException gets thrown in that case.
	 * @param trueString the String value that represents true:
	 * for example, "true" (VALUE_TRUE), "on" (VALUE_ON),
	 * "yes" (VALUE_YES) or some custom value
	 * @param falseString the String value that represents false:
	 * for example, "false" (VALUE_FALSE), "off" (VALUE_OFF),
	 * "no" (VALUE_NO) or some custom value
	 * @param allowEmpty if empty strings should be allowed
	 * @see #VALUE_TRUE
	 * @see #VALUE_FALSE
	 * @see #VALUE_ON
	 * @see #VALUE_OFF
	 * @see #VALUE_YES
	 * @see #VALUE_NO
	 */
	public CustomBooleanEditor(String trueString, String falseString, boolean allowEmpty) {
		this.trueString = trueString;
		this.falseString = falseString;
		this.allowEmpty = allowEmpty;
	}

	public void setAsText(String text) throws IllegalArgumentException {
		String input = (text != null ? text.trim() : null);
		if (this.allowEmpty && !StringUtils.hasLength(input)) {
			// Treat empty String as null value.
			setValue(null);
		}
		else if (this.trueString != null && input.equalsIgnoreCase(this.trueString)) {
			setValue(Boolean.TRUE);
		}
		else if (this.falseString != null && input.equalsIgnoreCase(this.falseString)) {
			setValue(Boolean.FALSE);
		}
		else if (this.trueString == null &&
				(input.equalsIgnoreCase(VALUE_TRUE) || input.equalsIgnoreCase(VALUE_ON) ||
				input.equalsIgnoreCase(VALUE_YES) || input.equals(VALUE_1))) {
			setValue(Boolean.TRUE);
		}
		else if (this.falseString == null &&
				(input.equalsIgnoreCase(VALUE_FALSE) || input.equalsIgnoreCase(VALUE_OFF) ||
				input.equalsIgnoreCase(VALUE_NO) || input.equals(VALUE_0))) {
			setValue(Boolean.FALSE);
		}
		else {
			throw new IllegalArgumentException("Invalid boolean value [" + text + "]");
		}
	}

	public String getAsText() {
		if (Boolean.TRUE.equals(getValue())) {
			return (this.trueString != null ? this.trueString : VALUE_TRUE);
		}
		else if (Boolean.FALSE.equals(getValue())) {
			return (this.falseString != null ? this.falseString : VALUE_FALSE);
		}
		else {
			return "";
		}
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲在线一区二区三区| 欧美日韩www| 粉嫩aⅴ一区二区三区四区五区 | 成人app网站| 国产黑丝在线一区二区三区| 久久成人18免费观看| 久久精品72免费观看| 精品制服美女丁香| 国产精品91一区二区| 成人免费毛片aaaaa**| 99麻豆久久久国产精品免费| 91蝌蚪porny| 欧美视频在线播放| 91精品国产黑色紧身裤美女| 亚洲综合久久久久| 亚洲一区在线看| 蜜臀av一区二区在线免费观看| 国精品**一区二区三区在线蜜桃| 91精品在线观看入口| 国产日韩精品一区二区浪潮av| 国产精品福利影院| 麻豆精品一二三| 99久久精品国产一区| 日韩精品一区二区三区在线观看| 中文字幕欧美区| 欧美在线色视频| 欧美视频一区在线观看| 日韩欧美电影在线| 国产欧美一区二区精品久导航| 国产精品入口麻豆九色| 洋洋成人永久网站入口| 免费观看在线综合色| 国产91精品在线观看| 欧美午夜不卡视频| 久久蜜臀中文字幕| 亚洲免费色视频| 久久不见久久见免费视频7| 99久久婷婷国产| 日韩欧美一区二区久久婷婷| 日韩理论电影院| 精品夜夜嗨av一区二区三区| 91片在线免费观看| 久久伊99综合婷婷久久伊| 欧美妇女性影城| 天天亚洲美女在线视频| 亚洲色欲色欲www| a在线欧美一区| 成人免费小视频| 欧美日韩亚洲国产综合| 樱桃视频在线观看一区| 欧美久久久影院| 日韩电影在线免费观看| 2023国产精品| 91麻豆精品国产91久久久使用方法| 亚洲人xxxx| 天天操天天综合网| www.欧美日韩国产在线| 日韩一区二区中文字幕| 亚洲va欧美va人人爽| 91污在线观看| 国产精品久久久久久亚洲毛片 | 高清成人在线观看| 91精品国产综合久久久久| 色狠狠av一区二区三区| 国产无一区二区| 国产美女一区二区三区| 日韩欧美久久一区| 日韩成人av影视| 91精品国产全国免费观看| 亚洲精品伦理在线| 91网站在线观看视频| 日韩一区在线播放| 成人激情视频网站| 国产午夜精品久久久久久免费视| 毛片av一区二区三区| 欧美一区午夜精品| 久久精品国产一区二区三| 欧美一区二区私人影院日本| 日韩电影在线免费看| 日韩欧美一二三四区| 日本中文字幕一区| 欧美成人精品1314www| 久久精品国产成人一区二区三区 | proumb性欧美在线观看| 国产欧美精品一区二区色综合 | 欧日韩精品视频| 亚洲一区免费在线观看| 欧美日韩一区二区三区四区五区| 亚洲第一av色| 欧美电影免费观看高清完整版在| 国产一区在线精品| 国产精品素人视频| 99久久99久久综合| 亚洲小少妇裸体bbw| 日韩一级成人av| 国产精品一卡二卡| 亚洲人成精品久久久久久 | 卡一卡二国产精品 | 成人免费在线观看入口| 色婷婷综合久久久久中文一区二区| 亚洲女与黑人做爰| 911精品国产一区二区在线| 美女看a上一区| 国产精品久久久久久久裸模| 欧美日韩电影在线播放| 国产成人综合在线播放| 一卡二卡三卡日韩欧美| 日韩三级视频在线观看| 成人一道本在线| 丝袜美腿高跟呻吟高潮一区| 精品国精品国产| 一本大道久久a久久综合| 免费看精品久久片| 综合激情网...| 日韩欧美中文一区| 91麻豆国产福利在线观看| 美国毛片一区二区| 亚洲乱码中文字幕| 久久网这里都是精品| 欧美性猛交xxxxxxxx| 国产精品一区二区91| 日韩精品免费视频人成| 中文字幕在线免费不卡| 日韩午夜激情免费电影| 色国产综合视频| 成人免费va视频| 国产伦精品一区二区三区免费| 亚洲国产日韩在线一区模特| 亚洲视频综合在线| 久久亚洲精品小早川怜子| 欧美色成人综合| 99re这里只有精品视频首页| 国产精品一二三区在线| 日韩制服丝袜av| 一区二区日韩电影| 亚洲欧美日韩一区二区 | 日韩一区二区高清| 欧美最猛黑人xxxxx猛交| 成人精品国产免费网站| 狠狠色丁香婷婷综合| 天堂va蜜桃一区二区三区| 亚洲免费观看在线观看| 亚洲区小说区图片区qvod| 国产精品天干天干在线综合| 国产亚洲1区2区3区| www国产成人免费观看视频 深夜成人网| 色拍拍在线精品视频8848| av亚洲精华国产精华| 成人小视频免费观看| 国产成人在线视频播放| 国产河南妇女毛片精品久久久| 精品无人码麻豆乱码1区2区| 九九热在线视频观看这里只有精品| 视频一区二区欧美| 奇米在线7777在线精品| 蜜臀久久99精品久久久画质超高清| 青草av.久久免费一区| 日本不卡视频一二三区| 久久精品99国产国产精| 国产成人精品影视| 顶级嫩模精品视频在线看| 成人激情黄色小说| 97久久人人超碰| 欧美午夜一区二区三区免费大片| 欧美日韩国产大片| 日韩欧美视频一区| 国产亚洲午夜高清国产拍精品| 亚洲人成在线观看一区二区| 亚洲免费看黄网站| 日韩精品一卡二卡三卡四卡无卡| 免费成人在线影院| 国产美女精品在线| 99精品一区二区三区| 欧美最猛性xxxxx直播| 日韩欧美国产成人一区二区| 久久综合色一综合色88| 亚洲视频一区二区在线| 午夜成人免费电影| 国产伦精品一区二区三区免费迷| 99这里都是精品| 欧美精品亚洲二区| 欧美高清在线一区| 无码av中文一区二区三区桃花岛| 久久国产日韩欧美精品| av一区二区三区黑人| 欧美精品少妇一区二区三区| 久久久久成人黄色影片| 一区二区三区在线影院| 久久99久久99小草精品免视看| www.激情成人| 欧美一区二区网站| 中文字幕日韩精品一区| 美女在线观看视频一区二区| 91在线观看下载| 欧美tk—视频vk| 亚洲在线免费播放| 成人国产精品免费观看| 日韩欧美久久一区| 亚洲精品美国一| 成人黄色免费短视频|