Package org.adempiere.model
Class POWrapper
java.lang.Object
org.adempiere.model.POWrapper
- All Implemented Interfaces:
InvocationHandler
Wrap a PO object to a given interface.
Example usage:
Example usage:
public interface I_C_Invoice_Customized
{
public int getCustomValue1();
public void setCustomValue1(int customValue1);
public String getCustomString1();
public void setCustomString1(String customString1);
}
....
MInvoice invoice = ......;
I_C_Invoice_Customized invoiceCustomized = POWrapper.create(invoice, I_C_Invoice_Customized.class);
invoiceCustomized.setCustomValue1(12345);
invoiceCustomized.setCustomString1("my test string");
invoice.saveEx();
- Author:
- Teo Sarca, teo.sarca@gmail.com
-
Method Summary
-
Method Details
-
create
Create wrapper of type cl for po- Type Parameters:
T- iDempiere model interface type- Parameters:
po-cl- iDempiere model interface class- Returns:
- wrapped instance
-
getPO
Get wrapped PO instance- Type Parameters:
T-- Parameters:
model-- Returns:
- the wrapped PO
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
callDefaultFunction
protected Object callDefaultFunction(Object proxy, Method method, Object[] args, boolean nullIfNotSupported) Call default method of interface class- Parameters:
proxy-method-args-nullIfNotSupported- - return null if no default method is defined otherwise throw IllegalArgumentException- Returns:
-
getPO
- Returns:
- wrapped PO instance
-