1 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 36 37 public class MethodPermission extends AbsElement { 38 39 42 private String description = null; 43 44 47 private JLinkedList roleNameList = null; 48 49 52 private boolean unchecked = false; 53 54 57 private JLinkedList methodList = null; 58 59 60 63 public MethodPermission() { 64 super(); 65 roleNameList = new JLinkedList("role-name"); 66 methodList = new JLinkedList("method"); 67 } 68 69 73 public String getDescription() { 74 return description; 75 } 76 77 81 public void setDescription(String description) { 82 this.description = description; 83 } 84 85 89 public JLinkedList getRoleNameList() { 90 return roleNameList; 91 } 92 93 97 public void setRoleNameList(JLinkedList roleNameList) { 98 this.roleNameList = roleNameList; 99 } 100 101 105 public void addRoleName(String roleName) { 106 roleNameList.add(roleName); 107 } 108 109 113 public boolean isUnchecked() { 114 return unchecked; 115 } 116 117 120 public void setUnchecked() { 121 this.unchecked = true; 122 } 123 124 128 public JLinkedList getMethodList() { 129 return methodList; 130 } 131 132 136 public void setMethodList(JLinkedList methodList) { 137 this.methodList = methodList; 138 } 139 140 144 public void addMethod(Method method) { 145 methodList.add(method); 146 } 147 148 153 public String toXML(int indent) { 154 StringBuffer sb = new StringBuffer (); 155 sb.append(indent(indent)); 156 sb.append("<method-permission>\n"); 157 158 indent += 2; 159 160 sb.append(xmlElement(description, "description", indent)); 162 sb.append(roleNameList.toXML(indent)); 164 if (unchecked) { 166 sb.append(indent(indent)); 167 sb.append("<unchecked></unchecked>\n"); 168 } 169 sb.append(methodList.toXML(indent)); 171 indent -= 2; 172 sb.append(indent(indent)); 173 sb.append("</method-permission>\n"); 174 175 return sb.toString(); 176 } 177 } 178 | Popular Tags |