1 /*
2 * Demosys.
3 *
4 * Terms of license - http://opensource.org/licenses/apachepl.php
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 private UserController _controller = new UserController();
16
17 public UserView(String id, String name) {
18 setId(id);
19 setName(name);
20 }
21
22
23 public UserView() {}
24
25 public Object clone() {
26 try {
27 return super.clone();
28 }
29 catch (CloneNotSupportedException e) {
30 // Impossible
31 e.printStackTrace();
32 return null;
33 }
34 }
35
36
37 public ActionErrors controlSilently() {
38 return _controller.control(this);
39 }
40
41
42 public void control() throws InvalidUserException {
43 ActionErrors errors = _controller.control(this);
44 if (!errors.isEmpty()) {
45 throw new InvalidUserException(errors);
46 }
47 }
48
49
50 public String getName() {
51 return _name;
52 }
53
54
55 public void setName(String name) {
56 this._name = name;
57 }
58
59
60 public String getId() {
61 return _id;
62 }
63
64
65 public void setId(String id) {
66 this._id = id;
67 }
68
69
70 public String getEmail() {
71 return _email;
72 }
73
74
75 public void setEmail(String email) {
76 this._email = email;
77 }
78
79
80 public String getComment() {
81 return _comment;
82 }
83
84
85 public void setComment(String comment) {
86 this._comment = comment;
87 }
88 }
This page was automatically generated by Maven