1 27 package org.objectweb.jonas_ear.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsDescriptionElement; 30 import org.objectweb.jonas_lib.deployment.xml.DescriptionGroupXml; 31 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 32 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement; 33 34 39 40 public class Application 41 extends AbsDescriptionElement 42 implements TopLevelElement, DescriptionGroupXml { 43 44 47 private JLinkedList moduleList = null; 48 49 52 private JLinkedList securityRoleList = null; 53 54 55 58 public Application() { 59 super(); 60 moduleList = new JLinkedList("module"); 61 securityRoleList = new JLinkedList("security-role"); 62 } 63 64 68 public JLinkedList getModuleList() { 69 return moduleList; 70 } 71 72 76 public void setModuleList(JLinkedList moduleList) { 77 this.moduleList = moduleList; 78 } 79 80 84 public void addModule(Module module) { 85 moduleList.add(module); 86 } 87 88 92 public JLinkedList getSecurityRoleList() { 93 return securityRoleList; 94 } 95 96 100 public void setSecurityRoleList(JLinkedList securityRoleList) { 101 this.securityRoleList = securityRoleList; 102 } 103 104 108 public void addSecurityRole(SecurityRole securityRole) { 109 securityRoleList.add(securityRole); 110 } 111 112 117 public String toXML(int indent) { 118 StringBuffer sb = new StringBuffer (); 119 sb.append(indent(indent)); 120 sb.append("<application>\n"); 121 indent += 2; 122 123 sb.append(getIcon().toXML(indent)); 125 sb.append(xmlElement(getDisplayName(), "display-name", indent)); 127 sb.append(xmlElement(getDescription(), "description", indent)); 129 sb.append(moduleList.toXML(indent)); 131 sb.append(securityRoleList.toXML(indent)); 133 134 indent -= 2; 135 sb.append(indent(indent)); 136 sb.append("</application>\n"); 137 138 return sb.toString(); 139 } 140 } 141 | Popular Tags |