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

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

?? typeconverterdelegate.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
		}
		return editor;
	}

	/**
	 * Convert the value to the required type (if necessary from a String),
	 * using the given property editor.
	 * @param oldValue the previous value, if available (may be <code>null</code>)
	 * @param newValue the proposed new value
	 * @param requiredType the type we must convert to
	 * (or <code>null</code> if not known, for example in case of a collection element)
	 * @param editor the PropertyEditor to use
	 * @return the new value, possibly the result of type conversion
	 * @throws IllegalArgumentException if type conversion failed
	 */
	protected Object doConvertValue(Object oldValue, Object newValue, Class requiredType, PropertyEditor editor) {
		Object convertedValue = newValue;
		boolean sharedEditor = false;

		if (editor != null) {
			sharedEditor = this.propertyEditorRegistry.isSharedEditor(editor);
		}

		if (editor != null && !(convertedValue instanceof String)) {
			// Not a String -> use PropertyEditor's setValue.
			// With standard PropertyEditors, this will return the very same object;
			// we just want to allow special PropertyEditors to override setValue
			// for type conversion from non-String values to the required type.
			try {
				Object newConvertedValue = null;
				if (sharedEditor) {
					// Synchronized access to shared editor instance.
					synchronized (editor) {
						editor.setValue(convertedValue);
						newConvertedValue = editor.getValue();
					}
				}
				else {
					// Unsynchronized access to non-shared editor instance.
					editor.setValue(convertedValue);
					newConvertedValue = editor.getValue();
				}
				if (newConvertedValue != convertedValue) {
					convertedValue = newConvertedValue;
					// Reset PropertyEditor: It already did a proper conversion.
					// Don't use it again for a setAsText call.
					editor = null;
				}
			}
			catch (Exception ex) {
				if (logger.isDebugEnabled()) {
					logger.debug("PropertyEditor [" + editor.getClass().getName() + "] does not support setValue call", ex);
				}
				// Swallow and proceed.
			}
		}

		if (requiredType != null && !requiredType.isArray() && convertedValue instanceof String[]) {
			// Convert String array to a comma-separated String.
			// Only applies if no PropertyEditor converted the String array before.
			// The CSV String will be passed into a PropertyEditor's setAsText method, if any.
			if (logger.isTraceEnabled()) {
				logger.trace("Converting String array to comma-delimited String [" + convertedValue + "]");
			}
			convertedValue = StringUtils.arrayToCommaDelimitedString((String[]) convertedValue);
		}

		if (editor != null && convertedValue instanceof String) {
			// Use PropertyEditor's setAsText in case of a String value.
			if (logger.isTraceEnabled()) {
				logger.trace("Converting String to [" + requiredType + "] using property editor [" + editor + "]");
			}
			String newTextValue = (String) convertedValue;
			if (sharedEditor) {
				// Synchronized access to shared editor instance.
				synchronized (editor) {
					return doConvertTextValue(oldValue, newTextValue, editor);
				}
			}
			else {
				// Unsynchronized access to non-shared editor instance.
				return doConvertTextValue(oldValue, newTextValue, editor);
			}
		}

		return convertedValue;
	}

	/**
	 * Convert the given text value using the given property editor.
	 * @param oldValue the previous value, if available (may be <code>null</code>)
	 * @param newTextValue the proposed text value
	 * @param editor the PropertyEditor to use
	 * @return the converted value
	 */
	protected Object doConvertTextValue(Object oldValue, String newTextValue, PropertyEditor editor) {
		try {
			editor.setValue(oldValue);
		}
		catch (Exception ex) {
			if (logger.isDebugEnabled()) {
				logger.debug("PropertyEditor [" + editor.getClass().getName() + "] does not support setValue call", ex);
			}
			// Swallow and proceed.
		}
		editor.setAsText(newTextValue);
		return editor.getValue();
	}

	protected Object convertToTypedArray(Object input, String propertyName, Class componentType) {
		if (input instanceof Collection) {
			// Convert Collection elements to array elements.
			Collection coll = (Collection) input;
			Object result = Array.newInstance(componentType, coll.size());
			int i = 0;
			for (Iterator it = coll.iterator(); it.hasNext(); i++) {
				Object value = convertIfNecessary(
						buildIndexedPropertyName(propertyName, i), null, it.next(), componentType);
				Array.set(result, i, value);
			}
			return result;
		}
		else if (input.getClass().isArray()) {
			// Convert array elements, if necessary.
			if (componentType.equals(input.getClass().getComponentType()) &&
					!this.propertyEditorRegistry.hasCustomEditorForElement(componentType, propertyName)) {
				return input;
			}
			int arrayLength = Array.getLength(input);
			Object result = Array.newInstance(componentType, arrayLength);
			for (int i = 0; i < arrayLength; i++) {
				Object value = convertIfNecessary(
						buildIndexedPropertyName(propertyName, i), null, Array.get(input, i), componentType);
				Array.set(result, i, value);
			}
			return result;
		}
		else {
			// A plain value: convert it to an array with a single component.
			Object result = Array.newInstance(componentType, 1);
			Object value = convertIfNecessary(
					buildIndexedPropertyName(propertyName, 0), null, input, componentType);
			Array.set(result, 0, value);
			return result;
		}
	}

	protected Collection convertToTypedCollection(
			Collection original, String propertyName, MethodParameter methodParam) {

		Class elementType = null;
		if (methodParam != null && JdkVersion.isAtLeastJava15()) {
			elementType = GenericCollectionTypeResolver.getCollectionParameterType(methodParam);
		}
		if (elementType == null &&
				!this.propertyEditorRegistry.hasCustomEditorForElement(null, propertyName)) {
			return original;
		}

		Collection convertedCopy = null;
		Iterator it = null;
		try {
			it = original.iterator();
			if (it == null) {
				if (logger.isDebugEnabled()) {
					logger.debug("Collection of type [" + original.getClass().getName() +
							"] returned null Iterator - injecting original Collection as-is");
				}
				return original;
			}
			convertedCopy = CollectionFactory.createApproximateCollection(original, original.size());
		}
		catch (Throwable ex) {
			if (logger.isDebugEnabled()) {
				logger.debug("Cannot access Collection of type [" + original.getClass().getName() +
						"] - injecting original Collection as-is", ex);
			}
			return original;
		}
		boolean actuallyConverted = false;
		int i = 0;
		for (; it.hasNext(); i++) {
			Object element = it.next();
			String indexedPropertyName = buildIndexedPropertyName(propertyName, i);
			if (methodParam != null) {
				methodParam.increaseNestingLevel();
			}
			Object convertedElement =
					convertIfNecessary(indexedPropertyName, null, element, elementType, null, methodParam);
			if (methodParam != null) {
				methodParam.decreaseNestingLevel();
			}
			convertedCopy.add(convertedElement);
			actuallyConverted = actuallyConverted || (element != convertedElement);
		}
		return (actuallyConverted ? convertedCopy : original);
	}

	protected Map convertToTypedMap(Map original, String propertyName, MethodParameter methodParam) {
		Class keyType = null;
		Class valueType = null;
		if (methodParam != null && JdkVersion.isAtLeastJava15()) {
			keyType = GenericCollectionTypeResolver.getMapKeyParameterType(methodParam);
			valueType = GenericCollectionTypeResolver.getMapValueParameterType(methodParam);
		}
		if (keyType == null && valueType == null &&
				!this.propertyEditorRegistry.hasCustomEditorForElement(null, propertyName)) {
			return original;
		}

		Map convertedCopy = null;
		Iterator it = null;
		try {
			it = original.entrySet().iterator();
			if (it == null) {
				if (logger.isDebugEnabled()) {
					logger.debug("Map of type [" + original.getClass().getName() +
							"] returned null Iterator - injecting original Map as-is");
				}
			}
			convertedCopy = CollectionFactory.createApproximateMap(original, original.size());
		}
		catch (Throwable ex) {
			if (logger.isDebugEnabled()) {
				logger.debug("Cannot access Map of type [" + original.getClass().getName() +
						"] - injecting original Map as-is", ex);
			}
			return original;
		}
		boolean actuallyConverted = false;
		while (it.hasNext()) {
			Map.Entry entry = (Map.Entry) it.next();
			Object key = entry.getKey();
			Object value = entry.getValue();
			String keyedPropertyName = buildKeyedPropertyName(propertyName, key);
			if (methodParam != null) {
				methodParam.increaseNestingLevel();
				methodParam.setTypeIndexForCurrentLevel(0);
			}
			Object convertedKey = convertIfNecessary(keyedPropertyName, null, key, keyType, null, methodParam);
			if (methodParam != null) {
				methodParam.setTypeIndexForCurrentLevel(1);
			}
			Object convertedValue = convertIfNecessary(keyedPropertyName, null, value, valueType, null, methodParam);
			if (methodParam != null) {
				methodParam.decreaseNestingLevel();
			}
			convertedCopy.put(convertedKey, convertedValue);
			actuallyConverted = actuallyConverted || (key != convertedKey) || (value != convertedValue);
		}
		return (actuallyConverted ? convertedCopy : original);
	}

	private String buildIndexedPropertyName(String propertyName, int index) {
		return (propertyName != null ?
				propertyName + PropertyAccessor.PROPERTY_KEY_PREFIX + index + PropertyAccessor.PROPERTY_KEY_SUFFIX :
				null);
	}

	private String buildKeyedPropertyName(String propertyName, Object key) {
		return (propertyName != null ?
				propertyName + PropertyAccessor.PROPERTY_KEY_PREFIX + key + PropertyAccessor.PROPERTY_KEY_SUFFIX :
				null);
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天堂2016| 欧美四级电影网| 精品一区二区三区的国产在线播放| 亚洲伦理在线免费看| 国产精品不卡在线| 成人免费在线播放视频| 亚洲精品免费一二三区| 亚洲精品五月天| 爽好久久久欧美精品| 青椒成人免费视频| 国产在线精品免费| 成人黄色777网| 欧洲另类一二三四区| 欧美日本一区二区在线观看| 日韩欧美成人激情| 久久久久国产精品人| 国产精品成人免费| 日韩综合在线视频| 国产大陆亚洲精品国产| 97超碰欧美中文字幕| 欧美电影一区二区三区| 久久综合丝袜日本网| 中文字幕综合网| 日韩国产在线观看一区| 国产精品一区专区| 欧美日韩午夜精品| 久久久青草青青国产亚洲免观| 亚洲欧洲三级电影| 日韩精品乱码av一区二区| 国内成人精品2018免费看| 91碰在线视频| 亚洲精品在线三区| 亚洲综合成人网| 久久99久久99精品免视看婷婷| bt欧美亚洲午夜电影天堂| 91精品国产色综合久久不卡电影 | 日本一区二区视频在线| 一区二区免费在线| 国产一区二区三区观看| 91黄色小视频| 亚洲国产精品精华液ab| 视频一区欧美日韩| 99精品在线观看视频| 日韩欧美一二三区| 亚洲精品成人精品456| 国产精品资源在线看| 欧美日韩激情一区| 亚洲乱码国产乱码精品精可以看 | 欧美变态tickle挠乳网站| 亚洲男人的天堂av| 国产成人免费在线视频| 欧美午夜精品免费| 久久久久99精品国产片| 免费一级欧美片在线观看| 91香蕉视频mp4| 欧美国产精品一区| 国产麻豆精品95视频| 日韩欧美色综合网站| 亚洲成av人片在线观看无码| 92国产精品观看| 国产精品久久久久四虎| 国产又黄又大久久| 精品国产成人在线影院| 六月丁香婷婷色狠狠久久| 91超碰这里只有精品国产| 亚洲国产成人tv| 欧美图片一区二区三区| 亚洲精品乱码久久久久| 91久久人澡人人添人人爽欧美| 国产精品乱码一区二区三区软件| 国产一区二区不卡| 国产偷国产偷亚洲高清人白洁| 国内精品国产成人国产三级粉色| 欧美v国产在线一区二区三区| 午夜成人在线视频| 欧美日本一道本| 奇米色一区二区| 26uuu色噜噜精品一区| 国产一区二区主播在线| 久久色在线视频| 成人av免费网站| 一区二区三区在线观看网站| 欧美私人免费视频| 美女一区二区三区| 精品国免费一区二区三区| 国产精品一卡二卡在线观看| 欧美激情一区在线观看| 99在线热播精品免费| 亚洲精品v日韩精品| 欧美三级日韩三级国产三级| 日韩中文字幕一区二区三区| 欧美大片在线观看一区二区| 国产精品2024| 樱花影视一区二区| 日韩手机在线导航| 国产成人免费视频| 一区二区久久久久久| 91精品国产手机| 成人短视频下载| 午夜伊人狠狠久久| 久久精品亚洲乱码伦伦中文| 色综合天天在线| 久久99国产精品麻豆| 中文字幕在线观看不卡| 欧美三电影在线| 国产精品91xxx| 亚洲二区在线观看| 久久色视频免费观看| 日本丶国产丶欧美色综合| 看国产成人h片视频| 亚洲欧美日韩精品久久久久| 日韩丝袜美女视频| 91电影在线观看| 国产成人精品网址| 日韩av中文字幕一区二区三区| 欧美国产一区视频在线观看| 色狠狠综合天天综合综合| 美女国产一区二区三区| 亚洲乱码国产乱码精品精可以看| 日韩视频免费观看高清完整版在线观看 | 欧美tickle裸体挠脚心vk| 99re6这里只有精品视频在线观看| 三级欧美在线一区| 国产精品电影一区二区| 2017欧美狠狠色| 欧美人与性动xxxx| 91碰在线视频| 成人激情综合网站| 国产精品一二三区在线| 日本不卡123| 午夜私人影院久久久久| 自拍偷拍欧美精品| 国产视频一区二区三区在线观看| 91精品国产综合久久小美女| 一本大道久久a久久精品综合| 国产v日产∨综合v精品视频| 极品少妇xxxx精品少妇| 亚洲成a人片在线观看中文| 亚洲另类在线制服丝袜| 国产精品激情偷乱一区二区∴| 久久久噜噜噜久噜久久综合| 欧美一级欧美一级在线播放| 在线不卡一区二区| 欧美日韩成人在线| 6080国产精品一区二区| 777午夜精品免费视频| 欧美美女bb生活片| 欧美性高清videossexo| 欧美亚洲综合网| 欧美午夜在线一二页| 日本国产一区二区| 欧美三级电影网| 91精品久久久久久久久99蜜臂| 欧美一区二区精品| 精品久久一区二区| 久久久精品国产免大香伊| 久久久www成人免费毛片麻豆| 欧美精品一区二| 国产拍揄自揄精品视频麻豆| 精品91自产拍在线观看一区| 国产欧美日韩在线| 国产精品成人网| 亚洲成人一区在线| 久久精品国产秦先生| 极品少妇xxxx精品少妇| 成人精品视频一区二区三区 | 日韩精品电影在线观看| 美脚の诱脚舐め脚责91| 日本午夜精品一区二区三区电影 | 国产亚洲欧洲997久久综合 | 狠狠色2019综合网| 懂色av一区二区在线播放| 91美女片黄在线观看91美女| 在线观看亚洲一区| 欧美一区二区性放荡片| www亚洲一区| 亚洲精选免费视频| 奇米在线7777在线精品 | 亚洲综合在线视频| 麻豆一区二区三区| www.日韩av| 91麻豆精品国产自产在线观看一区| 欧美精品一区二区久久婷婷| 国产精品对白交换视频 | 国产91精品一区二区麻豆网站| fc2成人免费人成在线观看播放| 欧美日韩你懂的| 国产清纯在线一区二区www| 亚洲欧美日韩久久| 国产麻豆午夜三级精品| 欧美日精品一区视频| 国产欧美综合在线观看第十页 | 国产三级欧美三级日产三级99 | 欧美日韩高清一区二区三区| 久久精子c满五个校花| 亚洲高清一区二区三区| 国产麻豆91精品| 91精品国产综合久久久久久漫画 | 99国产精品久久久久久久久久| 欧美一区二区高清|