KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > accounting > InterLegalEntityMoneyTransfer


1 /*
2  * Created on 29.10.2004
3  */

4 package com.nightlabs.ipanema.accounting;
5
6 import com.nightlabs.ipanema.security.User;
7 import com.nightlabs.ipanema.accounting.Invoice;
8 import com.nightlabs.ipanema.trade.LegalEntity;
9 import com.nightlabs.ipanema.transfer.Anchor;
10 import com.nightlabs.ipanema.transfer.Transfer;
11 import com.nightlabs.ipanema.transfer.TransferRegistry;
12
13 /**
14  * An <tt>InterLegalEntityMoneyTransfer</tt> is a <tt>MoneyTransfer</tt> which
15  * happens between two LegalEntities.
16  * This means, <tt>from</tt> and <tt>to</tt> must be instances of <tt>LegalEntity</tt>.
17  *
18  * @author Marco Schulze - marco at nightlabs dot de
19  *
20  * @jdo.persistence-capable
21  * identity-type = "application"
22  * persistence-capable-superclass = "com.nightlabs.ipanema.accounting.MoneyTransfer"
23  * detachable = "true"
24  *
25  * @jdo.inheritance strategy = "new-table"
26  */

27 public class InterLegalEntityMoneyTransfer extends MoneyTransfer
28 {
29
30     protected InterLegalEntityMoneyTransfer() { }
31
32     public InterLegalEntityMoneyTransfer(TransferRegistry transferRegistry,
33             Transfer container, User initiator, Anchor from, Anchor to, Invoice invoice,
34             Currency currency, long amount)
35     {
36         super(transferRegistry, container, initiator, from, to, new Invoice[] {invoice}, currency,
37                 amount);
38         if (!(from instanceof LegalEntity))
39             throw new IllegalArgumentException JavaDoc("from must be an instance of LegalEntity, but is of type " + from.getClass().getName());
40
41         if (!(to instanceof LegalEntity))
42             throw new IllegalArgumentException JavaDoc("to must be an instance of LegalEntity, but is of type " + from.getClass().getName());
43     }
44
45 }
46
Popular Tags