001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: MethodDD.java 2054 2007-11-20 14:43:55Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.deployment.xml.struct.common;
025:
026: import java.util.LinkedList;
027: import java.util.List;
028:
029: /**
030: * This class defines the <method> element.
031: * @author Florent Benoit
032: */
033: public class MethodDD {
034:
035: /**
036: * Name of the method.
037: */
038: private String name = null;
039:
040: /**
041: * List of params.
042: */
043: private List<String> params = null;
044:
045: /**
046: * EJB-Name associated to this method.
047: */
048: private String ejbName = null;
049:
050: /**
051: * Default constructor.
052: */
053: public MethodDD() {
054: this .params = new LinkedList<String>();
055: }
056:
057: /**
058: * Gets the name of the method.
059: * @return the method's name.
060: */
061: public String getName() {
062: return name;
063: }
064:
065: /**
066: * Sets the name of the method.
067: * @param name the name of the method.
068: */
069: public void setName(final String name) {
070: this .name = name;
071: }
072:
073: /**
074: * Gets the params of this method.
075: * @return the method's name.
076: */
077: public List<String> getParams() {
078: return params;
079: }
080:
081: /**
082: * Add a param for this method.
083: * @param param the given parameter of the method
084: */
085: public void addParam(final String param) {
086: params.add(param);
087: }
088:
089: /**
090: * @return name of the EJB.
091: */
092: public String getEjbName() {
093: return ejbName;
094: }
095:
096: /**
097: * Sets the name of the EJB.
098: * @param ejbName the given name.
099: */
100: public void setEjbName(final String ejbName) {
101: this .ejbName = ejbName;
102: }
103:
104: /**
105: * @return string representation of this module.
106: */
107: @Override
108: public String toString() {
109: StringBuilder sb = new StringBuilder(MethodDD.class
110: .getSimpleName());
111: sb.append("[name=");
112: sb.append(name);
113:
114: if (ejbName != null) {
115: sb.append(", ejbName=");
116: sb.append(ejbName);
117: }
118:
119: if (params.size() > 0) {
120: sb.append(", params={");
121: for (String param : params) {
122: sb.append(param);
123: sb.append(",");
124: }
125: sb.append("}");
126: }
127: sb.append("]");
128: return sb.toString();
129: }
130: }
|