📄 bytearraypropertyeditor.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 + -