📄 checkpaymentconverter.java
字号:
/*
* CheckPaymentConverter.java
*
* Created on 2007��6��6��, ����8:42
*
* 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;
import com.housesale.hibernate.CheckPayment;
/**
*
* @author MSQ
*/
public class CheckPaymentConverter implements Converter {
/** Creates a new instance of CheckPaymentConverter */
public CheckPaymentConverter() {
}
public Object getAsObject(FacesContext facesContext, UIComponent uIComponent, String string) {
if (string == null) {
return null;
}
Integer id = new Integer(string);
CheckPaymentController controller = (CheckPaymentController) facesContext.getApplication().createValueBinding("#{checkPayment}").getValue(facesContext);
return controller.findCheckPayment(id);
}
public String getAsString(FacesContext facesContext, UIComponent uIComponent, Object object) {
if (object == null) {
return null;
}
if(object instanceof CheckPayment) {
CheckPayment o = (CheckPayment) object;
return "" + o.getCheckPaymentId();
} else {
throw new IllegalArgumentException("object:" + object + " of type:" + object.getClass().getName() + "; expected type: com.housesale.hibernate.CheckPayment");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -