📄 longconverter.java
字号:
/*
* BuildingConverter.java
*
* Created on 2007��5��29��, ����2:59
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.housesale.jsfbean;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
/**
*
* @author MSQ
*/
public class LongConverter implements Converter {
/** Creates a new instance of BuildingConverter */
public LongConverter() {
}
public Object getAsObject(FacesContext facesContext,
UIComponent uIComponent, String string) {
if (string == null) {
return null;
}
Long id = Long.valueOf(string);
return id;
}
public String getAsString(FacesContext facesContext,
UIComponent uIComponent, Object object) {
if (object == null) {
return null;
}
if (object instanceof Long) {
Long o = (Long) object;
String password = o.toString();
return "" + password;
} else {
throw new IllegalArgumentException("object:" + object + " of type:"
+ object.getClass().getName() + "; expected type: Long");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -