rewrite-impl-servlet 1.0.2.Final

org.ocpsoft.rewrite.servlet.config
Class Header

java.lang.Object
  extended by org.ocpsoft.rewrite.config.ConditionBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpCondition
          extended by org.ocpsoft.rewrite.servlet.config.Header
All Implemented Interfaces:
Condition

public class Header
extends HttpCondition

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

Author:
Lincoln Baxter, III

Method Summary
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
static Header exists(java.lang.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(java.lang.String name, java.lang.String value)
          Return a Header condition that matches against both header name and values.
static Header valueExists(java.lang.String value)
          Return a Header condition that matches only against the existence of a header with value matching the given pattern.
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate
 
Methods inherited from class org.ocpsoft.rewrite.config.ConditionBuilder
and, andNot, or, orNot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

matches

public static Header matches(java.lang.String name,
                             java.lang.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(java.lang.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(java.lang.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

rewrite-impl-servlet 1.0.2.Final

Copyright © 2012 OCPsoft. All Rights Reserved.