KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > xml > querying > impl > xtas > EmployeeBean


1 package org.exoplatform.services.xml.querying.impl.xtas;
2
3 public class EmployeeBean {
4     private String JavaDoc id;
5     private String JavaDoc firstname;
6     private String JavaDoc lastname;
7     private String JavaDoc telephone;
8     private Address address;
9
10     public EmployeeBean() {
11         address = new Address();
12     }
13
14     public String JavaDoc getId(){ return id; }
15
16     public void setId(String JavaDoc id){ this.id = id; }
17
18     public String JavaDoc getFirstname(){ return firstname; }
19
20     public void setFirstname(String JavaDoc firstname){ this.firstname = firstname; }
21
22     public String JavaDoc getLastname(){ return lastname; }
23
24     public void setLastname(String JavaDoc lastname){ this.lastname = lastname; }
25
26     public String JavaDoc getTelephone(){ return telephone; }
27
28     public void setTelephone(String JavaDoc telephone){ this.telephone = telephone; }
29
30     public Address getAddress()
31     {
32       return address;
33     }
34
35     public void setAddress(Address address){ this.address = address; }
36
37     public static String JavaDoc generateId()
38     {
39       long cTime = new java.util.Date JavaDoc().getTime();
40 // Must comply with XML id ...
41
return "N"+(new Long JavaDoc (cTime)).toString();
42     }
43
44     public String JavaDoc toString()
45     {
46       return id+":"+firstname+":"+lastname+":"+telephone+
47              "\nAddress:"+getAddress().toString();
48     }
49
50 }
51
Popular Tags