1 26 27 package org.objectweb.jonas_web.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 31 32 36 public class AuthConstraint extends AbsElement { 37 38 41 private JLinkedList descriptionList = null; 42 43 46 private JLinkedList roleNameList = null; 47 48 49 52 public AuthConstraint() { 53 super(); 54 descriptionList = new JLinkedList("description"); 55 roleNameList = new JLinkedList("role-name"); 56 } 57 58 59 61 65 public void addDescription(String description) { 66 descriptionList.add(description); 67 } 68 69 73 public void addRoleName(String roleName) { 74 roleNameList.add(roleName); 75 } 76 77 79 83 public JLinkedList getDescriptionList() { 84 return descriptionList; 85 } 86 87 91 public JLinkedList getRoleNameList() { 92 return roleNameList; 93 } 94 95 100 public String toXML(int indent) { 101 StringBuffer sb = new StringBuffer (); 102 sb.append(indent(indent)); 103 sb.append("<auth-constraint>\n"); 104 105 indent += 2; 106 sb.append(descriptionList.toXML(indent)); 108 109 sb.append(roleNameList.toXML(indent)); 111 112 indent -= 2; 113 sb.append(indent(indent)); 114 sb.append("</auth-constraint>\n"); 115 116 return sb.toString(); 117 } 118 119 } 120 | Popular Tags |