| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
package org.demosys.web.user; |
| 7 |
|
import org.apache.struts.action.ActionErrors; |
| 8 |
|
|
| 9 |
|
|
| 10 |
|
public class UserView implements Cloneable { |
| 11 |
|
private String _name; |
| 12 |
|
private String _id; |
| 13 |
|
private String _email; |
| 14 |
|
private String _comment; |
| 15 |
104 |
private UserController _controller = new UserController(); |
| 16 |
|
|
| 17 |
72 |
public UserView(String id, String name) { |
| 18 |
72 |
setId(id); |
| 19 |
72 |
setName(name); |
| 20 |
72 |
} |
| 21 |
|
|
| 22 |
|
|
| 23 |
64 |
public UserView() {} |
| 24 |
|
|
| 25 |
|
public Object clone() { |
| 26 |
|
try { |
| 27 |
104 |
return super.clone(); |
| 28 |
|
} |
| 29 |
|
catch (CloneNotSupportedException e) { |
| 30 |
|
|
| 31 |
0 |
e.printStackTrace(); |
| 32 |
0 |
return null; |
| 33 |
|
} |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
public ActionErrors controlSilently() { |
| 38 |
0 |
return _controller.control(this); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
public void control() throws InvalidUserException { |
| 43 |
92 |
ActionErrors errors = _controller.control(this); |
| 44 |
92 |
if (!errors.isEmpty()) { |
| 45 |
24 |
throw new InvalidUserException(errors); |
| 46 |
|
} |
| 47 |
68 |
} |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
public String getName() { |
| 51 |
220 |
return _name; |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
|
| 55 |
|
public void setName(String name) { |
| 56 |
136 |
this._name = name; |
| 57 |
136 |
} |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
public String getId() { |
| 61 |
344 |
return _id; |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
|
| 65 |
|
public void setId(String id) { |
| 66 |
136 |
this._id = id; |
| 67 |
136 |
} |
| 68 |
|
|
| 69 |
|
|
| 70 |
|
public String getEmail() { |
| 71 |
152 |
return _email; |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
|
| 75 |
|
public void setEmail(String email) { |
| 76 |
76 |
this._email = email; |
| 77 |
76 |
} |
| 78 |
|
|
| 79 |
|
|
| 80 |
|
public String getComment() { |
| 81 |
32 |
return _comment; |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
|
| 85 |
|
public void setComment(String comment) { |
| 86 |
72 |
this._comment = comment; |
| 87 |
72 |
} |
| 88 |
|
} |