com.oroad.stxx.util
Class UserAgentRegexpSelector

java.lang.Object
  extended bycom.oroad.stxx.util.UserAgentRegexpSelector
All Implemented Interfaces:
Selector

public class UserAgentRegexpSelector
extends java.lang.Object
implements Selector

Tries to match based on the configured browser types, using regular expressions Based on UserAgentSelector

Author:
Mark Renouf, Don Brown

Constructor Summary
UserAgentRegexpSelector()
           
 
Method Summary
 java.util.ArrayList findSelector(javax.servlet.http.HttpServletRequest request)
          Finds all matching selectors
 void initialize(StxxProperties props)
          Initializes the selector from the properties and builds the list of browser types and a regular expression pattern to match for each type.
 boolean matches(java.lang.String value, javax.servlet.http.HttpServletRequest request)
          Determines if the transform name is a browser type and if so, if the user agent matches the configured user agent pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAgentRegexpSelector

public UserAgentRegexpSelector()
Method Detail

initialize

public void initialize(StxxProperties props)
Initializes the selector from the properties and builds the list of browser types and a regular expression pattern to match for each type.

Specified by:
initialize in interface Selector
Parameters:
props - The stxx properties

findSelector

public java.util.ArrayList findSelector(javax.servlet.http.HttpServletRequest request)
Finds all matching selectors

Specified by:
findSelector in interface Selector
Parameters:
request - The request object
Returns:
A list of selector names

matches

public boolean matches(java.lang.String value,
                       javax.servlet.http.HttpServletRequest request)
Determines if the transform name is a browser type and if so, if the user agent matches the configured user agent pattern

Specified by:
matches in interface Selector
Parameters:
value - The selector to match
request - The request object
Returns:
True, if the selector is matched by the request