View Javadoc

1   package com.bm.ejb3metadata.annotations.impl;
2   
3   
4   /**
5    * Defines common methods used by Session Bean and Message Driven beans.
6    * @author Daniel Wiese
7    */
8   public class JCommonBean {
9   
10      /**
11       * Name of the bean.
12       */
13      private String name = null;
14  
15      /**
16       * Mapped name (could be used as JNDI name).
17       */
18      private String mappedName = null;
19  
20      /**
21       * Description.
22       */
23      private String description = null;
24  
25      /**
26       * Build an object that will be shared by EJB (Session + MDB).
27       */
28      public JCommonBean() {
29  
30      }
31  
32      /**
33       * @return the description.
34       */
35      public String getDescription() {
36          return description;
37      }
38  
39      /**
40       * Sets the description.
41       * @param description value of description
42       */
43      public void setDescription(final String description) {
44          this.description = description;
45      }
46  
47      /**
48       * @return the mapped name (JNDI ?)
49       */
50      public String getMappedName() {
51          return mappedName;
52      }
53  
54      /**
55       * Sets the mapped name.
56       * @param mappedName the value to set
57       */
58      public void setMappedName(final String mappedName) {
59          this.mappedName = mappedName;
60      }
61  
62      /**
63       * @return name of the bean.
64       */
65      public String getName() {
66          return name;
67      }
68  
69      /**
70       * Sets the bean name.
71       * @param name the bean's name
72       */
73      public void setName(final String name) {
74          this.name = name;
75      }
76  
77      /**
78       * @return string representation
79       */
80      @Override
81      public String toString() {
82          StringBuilder sb = new StringBuilder();
83          // classname
84          sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1));
85  
86          // name
87          sb.append("[name=");
88          sb.append(name);
89  
90          // mappedName
91          sb.append("[mappedName=");
92          sb.append(mappedName);
93  
94          // description
95          sb.append("[description=");
96          sb.append(description);
97  
98          sb.append("]");
99          return sb.toString();
100     }
101 }