00001
00027 package org.objectweb.jonas_rar.deployment.xml;
00028
00029 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
00030 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
00031 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
00032
00039 public class Connector extends AbsElement implements TopLevelElement {
00040
00044 private String displayName = null;
00045
00049 private JLinkedList descriptionList = null;
00050
00054 private Icon icon = null;
00055
00059 private String vendorName = null;
00060
00064 private String specVersion = null;
00065
00069 private String eisType = null;
00070
00074 private String version = null;
00075
00079 private String resourceadapterVersion = null;
00080
00084 private License license = null;
00085
00089 private Resourceadapter resourceadapter = null;
00090
00091
00095 public Connector() {
00096 super();
00097 descriptionList = new JLinkedList("description");
00098 }
00099
00104 public String getDisplayName() {
00105 return displayName;
00106 }
00107
00112 public void setDisplayName(String displayName) {
00113 this.displayName = displayName;
00114 }
00115
00120 public JLinkedList getDescriptionList() {
00121 return descriptionList;
00122 }
00123
00128 public void setDescriptionList(JLinkedList descriptionList) {
00129 this.descriptionList = descriptionList;
00130 }
00131
00136 public void addDescription(String description) {
00137 descriptionList.add(description);
00138 }
00139
00140
00145 public Icon getIcon() {
00146 return icon;
00147 }
00148
00153 public void setIcon(Icon icon) {
00154 this.icon = icon;
00155 }
00156
00157
00162 public String getVendorName() {
00163 return vendorName;
00164 }
00165
00170 public void setVendorName(String vendorName) {
00171 this.vendorName = vendorName;
00172 }
00173
00178 public String getSpecVersion() {
00179 return specVersion;
00180 }
00181
00186 public void setSpecVersion(String specVersion) {
00187 this.specVersion = specVersion;
00188 }
00189
00194 public String getEisType() {
00195 return eisType;
00196 }
00197
00202 public void setEisType(String eisType) {
00203 this.eisType = eisType;
00204 }
00205
00210 public String getVersion() {
00211 return version;
00212 }
00213
00218 public void setVersion(String version) {
00219 this.version = version;
00220 }
00221
00226 public String getResourceadapterVersion() {
00227 return resourceadapterVersion;
00228 }
00229
00234 public void setResourceadapterVersion(String resourceadapterVersion) {
00235 this.resourceadapterVersion = resourceadapterVersion;
00236 }
00237
00242 public License getLicense() {
00243 return license;
00244 }
00245
00250 public void setLicense(License license) {
00251 this.license = license;
00252 }
00253
00258 public Resourceadapter getResourceadapter() {
00259 return resourceadapter;
00260 }
00261
00266 public void setResourceadapter(Resourceadapter resourceadapter) {
00267 this.resourceadapter = resourceadapter;
00268 }
00269
00275 public String toXML(int indent) {
00276 StringBuffer sb = new StringBuffer();
00277 sb.append(indent(indent));
00278 sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
00279 sb.append("<connector");
00280 sb.append(xmlAttribute(specVersion, "version"));
00281 sb.append(">\n");
00282
00283 indent += 2;
00284
00285
00286 sb.append(descriptionList.toXML(indent));
00287
00288 sb.append(xmlElement(displayName, "display-name", indent));
00289
00290 if (icon != null) {
00291 sb.append(icon.toXML(indent));
00292 }
00293
00294 sb.append(xmlElement(vendorName, "vendor-name", indent));
00295
00296 sb.append(xmlElement(eisType, "eis-type", indent));
00297
00298 sb.append(xmlElement(resourceadapterVersion, "resourceadapter-version", indent));
00299
00300 if (license != null) {
00301 sb.append(license.toXML(indent));
00302 }
00303
00304 if (resourceadapter != null) {
00305 sb.append(resourceadapter.toXML(indent));
00306 }
00307 indent -= 2;
00308 sb.append(indent(indent));
00309 sb.append("</connector>\n");
00310
00311 return sb.toString();
00312 }
00313 }