|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.xsp.designer.context.XSPUserAgent
public class XSPUserAgent
Utility class to parse the user-agent header variable.
This variable contains the information sent by the client (browser, robot...) and used to identify the client.
See: http://web.archive.org/web/20061217053523/http://en.wikipedia.org/wiki/User_agent
Some Examples:
Field Summary | |
---|---|
static int |
BROWSER_CHROME
|
static int |
BROWSER_FIREFOX
|
static int |
BROWSER_IE
|
static int |
BROWSER_OPERA
|
static int |
BROWSER_SAFARI
|
static int |
BROWSER_UNKNOWN
|
Constructor Summary | |
---|---|
XSPUserAgent(java.lang.String userAgent)
Constructs a browser identifier with the HTTP request header that contains browser information. |
Method Summary | |
---|---|
java.lang.String |
getBrowser()
Returns a string that represents the browser common name. |
java.lang.String |
getBrowserVersion()
Returns the version number as a string. |
double |
getBrowserVersionNumber()
Returns the version number converted as a double. |
java.lang.String |
getUserAgent()
Get the USER-AGENT string. |
java.lang.String |
getVersion(java.lang.String entry)
Get the version for a particular entry. |
double |
getVersionNumber(java.lang.String entry)
Get the number version for a particular entry. |
boolean |
hasEntry(java.lang.String entry)
Check if an entry is available in the user agent. |
boolean |
isChrome()
Check if the browser is Google Chrome. |
boolean |
isChrome(double min,
double max)
Check if the browser is Chrome within a particular version range. |
boolean |
isFirefox()
Check if the browser is Firefox. |
boolean |
isFirefox(double min,
double max)
Check if the browser is Firefox within a particular version range. |
boolean |
isIE()
Check if the browser is Internet Explorer. |
boolean |
isIE(double min,
double max)
Check if the browser is Internet Explorer within a particular version range. |
boolean |
isOpera()
Check if the browser is Opera. |
boolean |
isOpera(double min,
double max)
Check if the browser is Opera within a particular version range. |
boolean |
isSafari()
Check if the browser is Safari. |
boolean |
isSafari(double min,
double max)
Check if the browser is Safari within a particular version range. |
java.lang.String |
parseVersion(int pos)
Extract a version # located at a particular position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BROWSER_UNKNOWN
public static final int BROWSER_FIREFOX
public static final int BROWSER_IE
public static final int BROWSER_OPERA
public static final int BROWSER_SAFARI
public static final int BROWSER_CHROME
Constructor Detail |
---|
public XSPUserAgent(java.lang.String userAgent)
Method Detail |
---|
public java.lang.String getUserAgent()
public boolean hasEntry(java.lang.String entry)
public java.lang.String getVersion(java.lang.String entry)
public double getVersionNumber(java.lang.String entry)
public java.lang.String parseVersion(int pos)
public java.lang.String getBrowser()
public java.lang.String getBrowserVersion()
public double getBrowserVersionNumber()
public boolean isFirefox()
public boolean isFirefox(double min, double max)
min
- the minimum accepted version number (inclusive)max
- the maximum accepted version number (inclusive)
public boolean isIE()
public boolean isIE(double min, double max)
min
- the minimum accepted version number (inclusive)max
- the maximum accepted version number (inclusive)
public boolean isOpera()
public boolean isOpera(double min, double max)
min
- the minimum accepted version number (inclusive)max
- the maximum accepted version number (inclusive)
public boolean isSafari()
public boolean isSafari(double min, double max)
min
- the minimum accepted version number (inclusive)max
- the maximum accepted version number (inclusive)
public boolean isChrome()
public boolean isChrome(double min, double max)
min
- the minimum accepted version number (inclusive)max
- the maximum accepted version number (inclusive)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |