KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > deployment > xml > JonasEjbRelation


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: JOnAS team
23  * --------------------------------------------------------------------------
24  * $Id: JonasEjbRelation.java,v 1.2 2004/05/10 11:45:44 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
31 /**
32  * This class defines the implementation of the element jonas-ejb-relation
33  *
34  * @author JOnAS team
35  */

36
37 public class JonasEjbRelation extends AbsElement {
38
39     /**
40      * ejb-relation-name
41      */

42     private String JavaDoc ejbRelationName = null;
43
44     /**
45      * jdbc-table-name
46      */

47     private String JavaDoc jdbcTableName = null;
48
49     /**
50      * jonas-ejb-relationship-role
51      */

52     private JLinkedList jonasEjbRelationshipRoleList = null;
53
54
55     /**
56      * Constructor
57      */

58     public JonasEjbRelation() {
59         super();
60         jonasEjbRelationshipRoleList = new JLinkedList("jonas-ejb-relationship-role");
61     }
62
63     /**
64      * Gets the ejb-relation-name
65      * @return the ejb-relation-name
66      */

67     public String JavaDoc getEjbRelationName() {
68         return ejbRelationName;
69     }
70
71     /**
72      * Set the ejb-relation-name
73      * @param ejbRelationName ejbRelationName
74      */

75     public void setEjbRelationName(String JavaDoc ejbRelationName) {
76         this.ejbRelationName = ejbRelationName;
77     }
78
79     /**
80      * Gets the jdbc-table-name
81      * @return the jdbc-table-name
82      */

83     public String JavaDoc getJdbcTableName() {
84         return jdbcTableName;
85     }
86
87     /**
88      * Set the jdbc-table-name
89      * @param jdbcTableName jdbcTableName
90      */

91     public void setJdbcTableName(String JavaDoc jdbcTableName) {
92         this.jdbcTableName = jdbcTableName;
93     }
94
95     /**
96      * Gets the jonas-ejb-relationship-role
97      * @return the jonas-ejb-relationship-role
98      */

99     public JLinkedList getJonasEjbRelationshipRoleList() {
100         return jonasEjbRelationshipRoleList;
101     }
102
103     /**
104      * Set the jonas-ejb-relationship-role
105      * @param jonasEjbRelationshipRoleList jonasEjbRelationshipRole
106      */

107     public void setJonasEjbRelationshipRoleList(JLinkedList jonasEjbRelationshipRoleList) {
108         this.jonasEjbRelationshipRoleList = jonasEjbRelationshipRoleList;
109     }
110
111     /**
112      * Add a new jonas-ejb-relationship-role element to this object
113      * @param jonasEjbRelationshipRole the jonasEjbRelationshipRoleobject
114      */

115     public void addJonasEjbRelationshipRole(JonasEjbRelationshipRole jonasEjbRelationshipRole) {
116         jonasEjbRelationshipRoleList.add(jonasEjbRelationshipRole);
117     }
118
119     /**
120      * Represents this element by it's XML description.
121      * @param indent use this indent for prexifing XML representation.
122      * @return the XML description of this object.
123      */

124     public String JavaDoc toXML(int indent) {
125         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
126         sb.append(indent(indent));
127         sb.append("<jonas-ejb-relation>\n");
128
129         indent += 2;
130
131         // ejb-relation-name
132
sb.append(xmlElement(ejbRelationName, "ejb-relation-name", indent));
133         // jdbc-table-name
134
sb.append(xmlElement(jdbcTableName, "jdbc-table-name", indent));
135         // jonas-ejb-relationship-role
136
sb.append(jonasEjbRelationshipRoleList.toXML(indent));
137         indent -= 2;
138         sb.append(indent(indent));
139         sb.append("</jonas-ejb-relation>\n");
140
141         return sb.toString();
142     }
143 }
144
Popular Tags