rewrite-impl-servlet 1.0.4.Final

org.ocpsoft.rewrite.servlet.config
Class Header

java.lang.Object
  extended by org.ocpsoft.rewrite.config.DefaultConditionBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpCondition
          extended by org.ocpsoft.rewrite.servlet.config.Header
All Implemented Interfaces:
Condition, ConditionBuilder, ConfigurationElement, Parameterized<IHeader,IHeader.HeaderParameter,String>, IHeader

public class Header
extends HttpCondition
implements IHeader

Responsible for asserting on HttpServletRequest.getHeader(String) values.

Author:
Lincoln Baxter, III

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ocpsoft.rewrite.servlet.config.IHeader
IHeader.HeaderParameter, IHeader.IHeaderParameter
 
Method Summary
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
static Header exists(String name)
          Return a Header condition that matches only against the existence of a header with a name matching the given pattern.
static Header matches(String name, String value)
          Return a Header condition that matches against both header name and values.
static Header valueExists(String value)
          Return a Header condition that matches only against the existence of a header with value matching the given pattern.
 IHeader.HeaderParameter where(String param)
           
 IHeader.HeaderParameter where(String param, Binding binding)
           
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate
 
Methods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, create, or, orNot, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ocpsoft.rewrite.config.ConditionBuilder
and, andNot, or, orNot
 
Methods inherited from interface org.ocpsoft.rewrite.config.Condition
evaluate
 

Method Detail

matches

public static Header matches(String name,
                             String value)
Return a Header condition that matches against both header name and values.

See also: HttpServletRequest.getHeader(String)

Parameters:
name - Regular expression matching the header name
value - Regular expression matching the header value

exists

public static Header exists(String name)
Return a Header condition that matches only against the existence of a header with a name matching the given pattern. The header value is ignored.

See also: HttpServletRequest.getHeader(String)

Parameters:
name - Regular expression matching the header name

valueExists

public static Header valueExists(String value)
Return a Header condition that matches only against the existence of a header with value matching the given pattern. The header name is ignored.

Parameters:
value - Regular expression matching the header value

evaluateHttp

public boolean evaluateHttp(HttpServletRewrite event,
                            EvaluationContext context)
Specified by:
evaluateHttp in class HttpCondition

where

public IHeader.HeaderParameter where(String param)
Specified by:
where in interface Parameterized<IHeader,IHeader.HeaderParameter,String>

where

public IHeader.HeaderParameter where(String param,
                                     Binding binding)
Specified by:
where in interface Parameterized<IHeader,IHeader.HeaderParameter,String>

rewrite-impl-servlet 1.0.4.Final

Copyright © 2012 OCPsoft. All Rights Reserved.