com.oroad.stxx.util
Class UserAgentSelector

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

public class UserAgentSelector
extends java.lang.Object
implements Selector

Tries to match based on the configured browser types

Author:
Don Brown, Jeff Pennal

Constructor Summary
UserAgentSelector()
           
 
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 substrings 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 substrings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAgentSelector

public UserAgentSelector()
Method Detail

initialize

public void initialize(StxxProperties props)
Initializes the selector from the properties and builds the list of browser types and substrings 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 substrings.

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