Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  //
  //  ========================================================================
  //  Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
  //  ------------------------------------------------------------------------
  //  All rights reserved. This program and the accompanying materials
  //  are made available under the terms of the Eclipse Public License v1.0
  //  and Apache License v2.0 which accompanies this distribution.
  //
  //      The Eclipse Public License is available at
 //      http://www.eclipse.org/legal/epl-v10.html
 //
 //      The Apache License v2.0 is available at
 //      http://www.opensource.org/licenses/apache2.0.php
 //
 //  You may elect to redistribute this code under either of these licenses.
 //  ========================================================================
 //
 
 package org.eclipse.jetty.servlet;
 
 
 
 
 public class FilterMapping implements Dumpable
 {
    
Dispatch types
 
     public static final int DEFAULT=0;
     public static final int REQUEST=1;
     public static final int FORWARD=2;
     public static final int INCLUDE=4;
     public static final int ERROR=8;
     public static final int ASYNC=16;
     public static final int ALL=31;
     
 
     /* ------------------------------------------------------------ */
    
Dispatch type from name
 
     public static DispatcherType dispatch(String type)
     {
         if ("request".equalsIgnoreCase(type))
             return .;
         if ("forward".equalsIgnoreCase(type))
             return .;
         if ("include".equalsIgnoreCase(type))
             return .;
         if ("error".equalsIgnoreCase(type))
             return .;
         if ("async".equalsIgnoreCase(type))
             return .;
         throw new IllegalArgumentException(type);
     }
     
     /* ------------------------------------------------------------ */
    
Dispatch type from name
 
     public static int dispatch(DispatcherType type)
     {
     	switch(type)
     	{
     	  case :
     		  return ;
     	  case :
     		  return ;
     	  case :
     		  return ;
     	  case :
     		  return ;
     	  case :
     		  return ;
     	}
         throw new IllegalArgumentException(type.toString());
     }
 	
 
     /* ------------------------------------------------------------ */
     /* ------------------------------------------------------------ */
     
 	
     private int _dispatches=;
     private String _filterName;
     private transient FilterHolder _holder;
     private String[] _pathSpecs;
     private String[] _servletNames;
 
     /* ------------------------------------------------------------ */
     public FilterMapping()
     {}
     
     /* ------------------------------------------------------------ */
    
Check if this filter applies to a path.

Parameters:
path The path to check or null to just check type
type The type of request: __REQUEST,__FORWARD,__INCLUDE, __ASYNC or __ERROR.
Returns:
True if this filter applies
    boolean appliesTo(String pathint type)
    {
        if (appliesTo(type))
        {
            for (int i=0;i<.;i++)
                if ([i]!=null &&  PathMap.match([i], path,true))
                    return true;
        }
        return false;
    }
    
    /* ------------------------------------------------------------ */
    
Check if this filter applies to a particular dispatch type.

    boolean appliesTo(int type)
    {
    	if (==0)
    		return type== || type== && .isAsyncSupported();
        return (&type)!=0;
    }
    
    /* ------------------------------------------------------------ */
    

Returns:
Returns the filterName.
    public String getFilterName()
    {
        return ;
    }
    
    /* ------------------------------------------------------------ */
    

Returns:
Returns the holder.
    {
        return ;
    }
    
    /* ------------------------------------------------------------ */
    

Returns:
Returns the pathSpec.
    public String[] getPathSpecs()
    {
        return ;
    }
    /* ------------------------------------------------------------ */
    public void setDispatcherTypes(EnumSet<DispatcherTypedispatcherTypes
    {
        =;
        if (dispatcherTypes!=null)
        {
            if (dispatcherTypes.contains(.)) 
                |=;
            if (dispatcherTypes.contains(.)) 
                |=;
            if (dispatcherTypes.contains(.)) 
                |=;
            if (dispatcherTypes.contains(.)) 
                |=;
            if (dispatcherTypes.contains(.)) 
                |=;
        }
    }
    
    /* ------------------------------------------------------------ */
    

Parameters:
dispatches The dispatches to set.
See also:
DEFAULT
REQUEST
ERROR
FORWARD
INCLUDE
    public void setDispatches(int dispatches)
    {
         = dispatches;
    }
    
    /* ------------------------------------------------------------ */
    

Parameters:
filterName The filterName to set.
    public void setFilterName(String filterName)
    {
         = filterName;
    }
    
    /* ------------------------------------------------------------ */
    

Parameters:
holder The holder to set.
    void setFilterHolder(FilterHolder holder)
    {
         = holder;
        setFilterName(holder.getName());
    }
    
    /* ------------------------------------------------------------ */
    

Parameters:
pathSpecs The Path specifications to which this filter should be mapped.
    public void setPathSpecs(String[] pathSpecs)
    {
         = pathSpecs;
    }
    
    /* ------------------------------------------------------------ */
    

Parameters:
pathSpec The pathSpec to set.
    public void setPathSpec(String pathSpec)
    {
         = new String[]{pathSpec};
    }
    
    /* ------------------------------------------------------------ */
    

Returns:
Returns the servletName.
    public String[] getServletNames()
    {
        return ;
    }
    
    /* ------------------------------------------------------------ */
    

Parameters:
servletNames Maps the named filter to multiple servlets
See also:
setServletName(java.lang.String)
    public void setServletNames(String[] servletNames)
    {
         = servletNames;
    }
    
    /* ------------------------------------------------------------ */
    

Parameters:
servletName Maps the named filter to a single servlet
See also:
setServletNames(java.lang.String[])
    public void setServletName(String servletName)
    {
         = new String[]{servletName};
    }
    /* ------------------------------------------------------------ */
    public String toString()
    {
        return 
        TypeUtil.asList()+"/"+
        TypeUtil.asList()+"=="+
        +"=>"+
        
    }
    /* ------------------------------------------------------------ */
    public void dump(Appendable outString indentthrows IOException
    {
        out.append(String.valueOf(this)).append("\n");
    }
    /* ------------------------------------------------------------ */
    public String dump()
    {
        return AggregateLifeCycle.dump(this);
    }    
New to GrepCode? Check out our FAQ X