WebResourceCollection.java

00001 
00027 package org.objectweb.jonas_web.deployment.xml;
00028 
00029 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
00030 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
00031 
00036 public class WebResourceCollection extends AbsElement {
00037 
00041     private String webResourceName = null;
00042 
00046     private JLinkedList descriptionList = null;
00047 
00051     private JLinkedList urlPatternList = null;
00052 
00056     private JLinkedList httpMethodList = null;
00057 
00061     public WebResourceCollection() {
00062         super();
00063         descriptionList = new  JLinkedList("description");
00064         urlPatternList = new  JLinkedList("url-pattern");
00065         httpMethodList = new  JLinkedList("http-method");
00066     }
00067 
00068 
00069     // Setters
00070 
00075     public void setWebResourceName(String webResourceName) {
00076         this.webResourceName = webResourceName;
00077     }
00078 
00079 
00084     public void addDescription(String description) {
00085         descriptionList.add(description);
00086     }
00087 
00092     public void addUrlPattern(String urlPattern) {
00093         urlPatternList.add(urlPattern);
00094     }
00095 
00100     public void addHttpMethod(String httpMethod) {
00101         httpMethodList.add(httpMethod);
00102     }
00103 
00104 
00105     // Getters
00106 
00111     public String getWebResourceName() {
00112         return webResourceName;
00113     }
00114 
00119     public JLinkedList getDescriptionList() {
00120         return descriptionList;
00121     }
00122 
00127     public JLinkedList getUrlPatternList() {
00128         return urlPatternList;
00129     }
00130 
00135     public JLinkedList getHttpMethodList() {
00136         return httpMethodList;
00137     }
00138 
00144     public String toXML(int indent) {
00145         StringBuffer sb = new StringBuffer();
00146         sb.append(indent(indent));
00147         sb.append("<web-resource-collection>\n");
00148 
00149         indent += 2;
00150         // web-resource-name
00151         if (webResourceName != null) {
00152             sb.append(xmlElement(webResourceName, "web-resource-name", indent));
00153         }
00154 
00155         // description
00156         sb.append(descriptionList.toXML(indent));
00157 
00158         // url-pattern
00159         sb.append(urlPatternList.toXML(indent));
00160 
00161         // http-method
00162         sb.append(httpMethodList.toXML(indent));
00163 
00164 
00165         indent -= 2;
00166         sb.append(indent(indent));
00167         sb.append("</web-resource-collection>\n");
00168 
00169         return sb.toString();
00170     }
00171 
00172 }

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