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

📄 bytearraypropertyeditor.java

📁 spring的源代码
💻 JAVA
字号:
package org.springframework.beans.propertyeditors;

import java.beans.PropertyEditorSupport;

/**
 * Editor for byte arrays. Strings will simply be converted to their
 * corresponding byte representations.
 *
 * <p>This property editor is automatically registered by BeanWrapperImpl.
 *
 * @author Juergen Hoeller
 * @since 02.04.2004
 * @see java.lang.String#getBytes
 * @see org.springframework.beans.BeanWrapperImpl
 */
public class ByteArrayPropertyEditor extends PropertyEditorSupport {

	public void setAsText(String text) {
		setValue(text.getBytes());
	}

	public String getAsText() {
		byte[] value = (byte[]) getValue();
		return (value != null ? new String(value) : "null");
	}

}

⌨️ 快捷键说明

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