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 WebResourceCollection extends AbsElement { 37 38 41 private String webResourceName = null; 42 43 46 private JLinkedList descriptionList = null; 47 48 51 private JLinkedList urlPatternList = null; 52 53 56 private JLinkedList httpMethodList = null; 57 58 61 public WebResourceCollection() { 62 super(); 63 descriptionList = new JLinkedList("description"); 64 urlPatternList = new JLinkedList("url-pattern"); 65 httpMethodList = new JLinkedList("http-method"); 66 } 67 68 69 71 75 public void setWebResourceName(String webResourceName) { 76 this.webResourceName = webResourceName; 77 } 78 79 80 84 public void addDescription(String description) { 85 descriptionList.add(description); 86 } 87 88 92 public void addUrlPattern(String urlPattern) { 93 urlPatternList.add(urlPattern); 94 } 95 96 100 public void addHttpMethod(String httpMethod) { 101 httpMethodList.add(httpMethod); 102 } 103 104 105 107 111 public String getWebResourceName() { 112 return webResourceName; 113 } 114 115 119 public JLinkedList getDescriptionList() { 120 return descriptionList; 121 } 122 123 127 public JLinkedList getUrlPatternList() { 128 return urlPatternList; 129 } 130 131 135 public JLinkedList getHttpMethodList() { 136 return httpMethodList; 137 } 138 139 144 public String toXML(int indent) { 145 StringBuffer sb = new StringBuffer (); 146 sb.append(indent(indent)); 147 sb.append("<web-resource-collection>\n"); 148 149 indent += 2; 150 if (webResourceName != null) { 152 sb.append(xmlElement(webResourceName, "web-resource-name", indent)); 153 } 154 155 sb.append(descriptionList.toXML(indent)); 157 158 sb.append(urlPatternList.toXML(indent)); 160 161 sb.append(httpMethodList.toXML(indent)); 163 164 165 indent -= 2; 166 sb.append(indent(indent)); 167 sb.append("</web-resource-collection>\n"); 168 169 return sb.toString(); 170 } 171 172 } 173 | Popular Tags |