01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package edu.sampleu.travel.document;
17:
18: import java.util.ArrayList;
19: import java.util.LinkedHashMap;
20: import java.util.List;
21:
22: import org.kuali.core.document.TransactionalDocumentBase;
23:
24: import edu.sampleu.travel.bo.TravelAccount;
25:
26: public class TravelDocument2 extends TransactionalDocumentBase {
27:
28: private String traveler;
29: private String origin;
30: private String destination;
31: private String requestType;
32:
33: private List<TravelAccount> travelAccounts;
34:
35: public TravelDocument2() {
36: travelAccounts = new ArrayList<TravelAccount>();
37: }
38:
39: @Override
40: protected LinkedHashMap toStringMapper() {
41: LinkedHashMap<String, String> meMap = new LinkedHashMap<String, String>();
42: meMap.put("traveler", getTraveler());
43: meMap.put("origin", getOrigin());
44: meMap.put("destination", getDestination());
45: return meMap;
46: }
47:
48: public String getDestination() {
49: return destination;
50: }
51:
52: public void setDestination(String destination) {
53: this .destination = destination;
54: }
55:
56: public String getOrigin() {
57: return origin;
58: }
59:
60: public void setOrigin(String origin) {
61: this .origin = origin;
62: }
63:
64: public String getTraveler() {
65: return traveler;
66: }
67:
68: public void setTraveler(String traveler) {
69: this .traveler = traveler;
70: }
71:
72: public List<TravelAccount> getTravelAccounts() {
73: return travelAccounts;
74: }
75:
76: public void setTravelAccounts(List<TravelAccount> travelAccounts) {
77: this .travelAccounts = travelAccounts;
78: }
79:
80: public TravelAccount getTravelAccount(int index) {
81: while (travelAccounts.size() - 1 < index) {
82: travelAccounts.add(new TravelAccount());
83: }
84: return travelAccounts.get(index);
85: }
86:
87: public String getRequestType() {
88: return requestType;
89: }
90:
91: public void setRequestType(String requestType) {
92: this.requestType = requestType;
93: }
94:
95: }
|