FileDocCategorySizeDatePackage
ServletFilterDescriptor.javaAPI DocGlassfish v2 API5600Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

ServletFilterDescriptor

public class ServletFilterDescriptor extends Descriptor implements com.sun.enterprise.deployment.web.ServletFilter
Deployment object representing the servlet filter spec
author
Martin D. Flynn

Fields Summary
private String
className
class name
private String
displayName
display name
private String
filterName
filter name
private Vector
initParms
initialization parameters
Constructors Summary
public ServletFilterDescriptor()
generic constructor


    /* ----
    */

       
      
	super("", ""/*description*/);
	this.setClassName("");
    
public ServletFilterDescriptor(String className, String name)
constructor specifying descriptor name (Filter name) & displayName

	super(name, ""/*description*/);
	this.setClassName(className);
    
Methods Summary
public voidaddInitializationParameter(com.sun.enterprise.deployment.web.InitializationParameter ref)

	this.initParms.addElement(ref);
    
public voidaddInitializationParameter(com.sun.enterprise.deployment.EnvironmentProperty ref)

	addInitializationParameter((InitializationParameter) ref);
    
public booleanequals(java.lang.Object obj)
compare equals

        //Should allow a filter with different name mapping
        //to the same class.
        if (obj instanceof ServletFilter) {
	    if (this.getClassName().equals(
                        ((ServletFilter)obj).getClassName())
                    && this.getName().equals(
                            ((ServletFilter)obj).getName())) {
                return true;
            }
        }

        return false;
    
public java.lang.StringgetClassName()
get class name

	if (this.className == null) {
	    this.className = "";
	}
	return this.className;
    
public java.lang.StringgetDisplayName()
get display name

	String n = this.displayName;
	if ((n == null) || n.equals("")) {
	    n = this.getName();
	}
	return n;
    
public java.util.VectorgetInitializationParameters()

	return (Vector)this.initParms.clone();
    
public java.lang.StringgetName()
get filter name

	if ((filterName == null) || filterName.equals("")) {
	    String c = this.getClassName();
	    int p = c.lastIndexOf('.");
	    filterName = (p < 0)? c : c.substring(p + 1);
	}
	return filterName;
    
public inthashCode()

        int result = 17;
        result = 37*result + getClassName().hashCode();
        result = 37*result + getName().hashCode();
        return result;
    
public voidremoveInitializationParameter(com.sun.enterprise.deployment.web.InitializationParameter ref)

	this.initParms.removeElement(ref);
    
public voidsetClassName(java.lang.String name)
set class name

	this.className = (name != null)? name : "";
    
public voidsetDisplayName(java.lang.String name)
set display name

	this.displayName = (name != null)? name : "";
    
public voidsetInitializationParameters(java.util.Collection c)

	this.initParms.clear();
	this.initParms.addAll(c);
    
public voidsetName(java.lang.String filterName)
set filter name

        this.filterName = filterName;