Application.java

00001 
00027 package org.objectweb.jonas_ear.deployment.xml;
00028 
00029 import org.objectweb.jonas_lib.deployment.xml.AbsDescriptionElement;
00030 import org.objectweb.jonas_lib.deployment.xml.DescriptionGroupXml;
00031 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
00032 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
00033 
00040 public class Application
00041     extends AbsDescriptionElement
00042     implements TopLevelElement, DescriptionGroupXml {
00043 
00047     private JLinkedList moduleList = null;
00048 
00052     private JLinkedList securityRoleList = null;
00053 
00054 
00058     public Application() {
00059         super();
00060         moduleList = new  JLinkedList("module");
00061         securityRoleList = new  JLinkedList("security-role");
00062     }
00063 
00068     public JLinkedList getModuleList() {
00069         return moduleList;
00070     }
00071 
00076     public void setModuleList(JLinkedList moduleList) {
00077         this.moduleList = moduleList;
00078     }
00079 
00084     public void addModule(Module module) {
00085         moduleList.add(module);
00086     }
00087 
00092     public JLinkedList getSecurityRoleList() {
00093         return securityRoleList;
00094     }
00095 
00100     public void setSecurityRoleList(JLinkedList securityRoleList) {
00101         this.securityRoleList = securityRoleList;
00102     }
00103 
00108     public void addSecurityRole(SecurityRole securityRole) {
00109         securityRoleList.add(securityRole);
00110     }
00111 
00117     public String toXML(int indent) {
00118         StringBuffer sb = new StringBuffer();
00119         sb.append(indent(indent));
00120         sb.append("<application>\n");
00121         indent += 2;
00122 
00123         // icon
00124         sb.append(getIcon().toXML(indent));
00125         // display-name
00126         sb.append(xmlElement(getDisplayName(), "display-name", indent));
00127         // description
00128         sb.append(xmlElement(getDescription(), "description", indent));
00129         // module
00130         sb.append(moduleList.toXML(indent));
00131         // security-role
00132         sb.append(securityRoleList.toXML(indent));
00133 
00134         indent -= 2;
00135         sb.append(indent(indent));
00136         sb.append("</application>\n");
00137 
00138         return sb.toString();
00139     }
00140 }

Generated on Tue Feb 15 15:05:36 2005 for JOnAS by  doxygen 1.3.9.1