KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jspPhoneBook > business > Person


1 package jspPhoneBook.business;
2
3 import jspPhoneBook.data.PersonDO;
4
5
6 /**
7  * Person defines the business level methods available to modify
8  * a person. This object would enforce any business logic....
9  * it isn't really used by this demo.
10  */

11 public class Person {
12
13     private PersonDO p;
14
15     protected Person(PersonDO p) {
16         this.p = p;
17     }
18
19     public String JavaDoc getFirstName() {
20         try {
21             return p.getFirstName();
22         } catch (Exception JavaDoc e) {
23             System.out.println(e);
24             return "";
25         }
26     }
27
28     public String JavaDoc getLastName() {
29         try {
30             return p.getLastName();
31         } catch (Exception JavaDoc e) {
32             System.out.println(e);
33             return "";
34         }
35     }
36
37     public String JavaDoc getPhoneNumber() {
38         try {
39             return p.getPhoneNumber();
40         } catch (Exception JavaDoc e) {
41             System.out.println(e);
42             return "";
43         }
44     }
45
46     public String JavaDoc getId() throws Exception JavaDoc {
47         try {
48             return "" + p.getOId();
49         } catch (Exception JavaDoc e) {
50             System.out.println(e);
51             return "";
52         }
53     }
54
55 }
56
57
58
Popular Tags