001: package com.bm.ejb3metadata.annotations.impl;
002:
003: /**
004: * Defines common methods used by Session Bean and Message Driven beans.
005: * @author Daniel Wiese
006: */
007: public class JCommonBean {
008:
009: /**
010: * Name of the bean.
011: */
012: private String name = null;
013:
014: /**
015: * Mapped name (could be used as JNDI name).
016: */
017: private String mappedName = null;
018:
019: /**
020: * Description.
021: */
022: private String description = null;
023:
024: /**
025: * Build an object that will be shared by EJB (Session + MDB).
026: */
027: public JCommonBean() {
028:
029: }
030:
031: /**
032: * @return the description.
033: */
034: public String getDescription() {
035: return description;
036: }
037:
038: /**
039: * Sets the description.
040: * @param description value of description
041: */
042: public void setDescription(final String description) {
043: this .description = description;
044: }
045:
046: /**
047: * @return the mapped name (JNDI ?)
048: */
049: public String getMappedName() {
050: return mappedName;
051: }
052:
053: /**
054: * Sets the mapped name.
055: * @param mappedName the value to set
056: */
057: public void setMappedName(final String mappedName) {
058: this .mappedName = mappedName;
059: }
060:
061: /**
062: * @return name of the bean.
063: */
064: public String getName() {
065: return name;
066: }
067:
068: /**
069: * Sets the bean name.
070: * @param name the bean's name
071: */
072: public void setName(final String name) {
073: this .name = name;
074: }
075:
076: /**
077: * @return string representation
078: */
079: @Override
080: public String toString() {
081: StringBuilder sb = new StringBuilder();
082: // classname
083: sb.append(this .getClass().getName().substring(
084: this .getClass().getPackage().getName().length() + 1));
085:
086: // name
087: sb.append("[name=");
088: sb.append(name);
089:
090: // mappedName
091: sb.append("[mappedName=");
092: sb.append(mappedName);
093:
094: // description
095: sb.append("[description=");
096: sb.append(description);
097:
098: sb.append("]");
099: return sb.toString();
100: }
101: }
|