001: package com.bm.ejb3metadata.annotations.impl;
002:
003: /**
004: * Acts as an implementation of @{@link javax.ejb.EJB} annotation.
005: * @author Daniel Wiese
006: */
007: public class JEjbEJB {
008:
009: /**
010: * Name (resource to be looked up).
011: */
012: private String name = null;
013:
014: /**
015: * Business or home Interface.
016: */
017: private String beanInterface = null;
018:
019: /**
020: * Bean name (Name of stateless, stateful, etc. or ejb-name).
021: */
022: private String beanName = null;
023:
024: /**
025: * mapped name.
026: */
027: private String mappedName = null;
028:
029: /**
030: * Constructor.<br>
031: * Build object with default values.
032: */
033: public JEjbEJB() {
034: this .name = "";
035: this .beanName = "";
036: this .mappedName = null;
037: }
038:
039: /**
040: * @return Name (resource to be looked up).
041: */
042: public String getName() {
043: return name;
044: }
045:
046: /**
047: * Sets Name (resource to be looked up).
048: * @param name the given name.
049: */
050: public void setName(final String name) {
051: this .name = name;
052: }
053:
054: /**
055: * @return Bean name (Name of stateless, stateful, etc. or ejb-name).
056: */
057: public String getBeanName() {
058: return beanName;
059: }
060:
061: /**
062: * Sets bean name (Name of stateless, stateful, etc. or ejb-name).
063: * @param beanName the given name.
064: */
065: public void setBeanName(final String beanName) {
066: this .beanName = beanName;
067: }
068:
069: /**
070: * @return business or home Interface.
071: */
072: public String getBeanInterface() {
073: return beanInterface;
074: }
075:
076: /**
077: * Sets the business or home Interface.
078: * @param beanInterface the given interface.
079: */
080: public void setBeanInterface(final String beanInterface) {
081: this .beanInterface = beanInterface;
082: }
083:
084: /**
085: * @return MappedName.
086: */
087: public String getMappedName() {
088: return mappedName;
089: }
090:
091: /**
092: * Sets mapped Name.
093: * @param mappedName the given mappedName.
094: */
095: public void setMappedName(final String mappedName) {
096: this .mappedName = mappedName;
097: }
098:
099: /**
100: * @return string representation
101: */
102: @Override
103: public String toString() {
104: StringBuilder sb = new StringBuilder();
105: // classname
106: sb.append(this .getClass().getName().substring(
107: this .getClass().getPackage().getName().length() + 1));
108:
109: // name
110: sb.append("[name=");
111: sb.append(name);
112:
113: // mappedName
114: sb.append(", mappedName=");
115: sb.append(mappedName);
116:
117: // beanInterface
118: sb.append(", beanInterface=");
119: sb.append(beanInterface);
120:
121: // property value
122: sb.append(", beanName=");
123: sb.append(beanName);
124:
125: sb.append("]");
126: return sb.toString();
127: }
128: }
|