FileDocCategorySizeDatePackage
WebResourceCollectionImpl.javaAPI DocGlassfish v2 API5354Fri May 04 22:31:24 BST 2007com.sun.enterprise.deployment

WebResourceCollectionImpl

public class WebResourceCollectionImpl extends Descriptor implements com.sun.enterprise.deployment.web.WebResourceCollection
This descriptor represents a description of a portion of a web app in terms of a collection of url patterns and a collection of http methods on this patterns.
author
Danny Coward

Fields Summary
private Set
urlPatterns
private Set
httpMethods
Constructors Summary
Methods Summary
public voidaddHttpMethod(java.lang.String httpMethod)
Adds the given HTTP method to the collection of http methods this collection has.

param
the HTTP method to be added.

	this.getHttpMethodsSet().add(httpMethod);
    
public voidaddUrlPattern(java.lang.String urlPattern)
Add a URL pattern to this collection.

param
the url pattern to be added.

	this.getUrlPatternsSet().add(urlPattern);
    
public java.util.EnumerationgetHttpMethods()
Return the enumeration of HTTP methods this collection has.

return
the enumeration of HTTP methods.

	return (new Vector(this.getHttpMethodsSet())).elements();
    
public java.lang.String[]getHttpMethodsAsArray()
Returns the HttpMethods this collection has in an array of strings

return
array of strings of HttpMethods

	if(httpMethods == null){
	    return (String[]) null;
	}
	String[] array = (String[])httpMethods.toArray(new String[0]);
	return array;
    
private java.util.SetgetHttpMethodsSet()

	if (this.httpMethods == null) {
	    this.httpMethods = new HashSet();
	}
	return this.httpMethods;
    
public java.util.EnumerationgetUrlPatterns()
Return my urls patterns (String objects)

return
the enumeration of the url patterns.

	return (new Vector(this.getUrlPatternsSet())).elements();
    
private java.util.SetgetUrlPatternsSet()

	if (this.urlPatterns == null) {
	    this.urlPatterns = new HashSet();
	}
	return this.urlPatterns;
    
public voidprint(java.lang.StringBuffer toStringBuffer)
A formatted string of the state.

	toStringBuffer.append("WebresourceCollection: ");
	toStringBuffer.append(" urlPatterns: ").append(this.urlPatterns);
	toStringBuffer.append(" httpMethods ").append(this.httpMethods);
    
public voidremoveHttpMethod(java.lang.String httpMethod)
Removes the given HTTP method from the collection of http methods.

param
the HTTP method to be removed.

	this.getHttpMethodsSet().remove(httpMethod);    
    
public voidremoveUrlPattern(java.lang.String urlPattern)
Remove the specified url pattern from the collection.

param
the url pattern to be removed.

	this.getUrlPatternsSet().remove(urlPattern);
    
public voidsetHttpMethods(java.util.Set httpMethods)
Sets the set of HTTP methods this collection has.

param
the set of HTTP methods.

	this.httpMethods = httpMethods;
    
public voidsetUrlPatterns(java.util.Set urlPatterns)
Clean out the collection of URL pattern and replace it with the given Set of (String) url patterns.

param
the url patterns to replace the current set.

	this.urlPatterns = urlPatterns;