public class Browser
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Browser.OS |
Modifier and Type | Field and Description |
---|---|
protected static org.apache.oro.text.regex.Pattern |
botPattern |
static java.lang.String |
botPatternStr |
protected java.lang.String |
browserName |
protected java.lang.String |
browserVersion |
protected boolean |
isAndroid |
protected boolean |
isBlackberry |
protected boolean |
isChrome |
protected boolean |
isChromeFrame |
protected boolean |
isFirefox |
protected boolean |
isIE |
protected boolean |
isIE5 |
protected boolean |
isIE55 |
protected boolean |
isIE6 |
protected boolean |
isIE7 |
protected boolean |
isIE8 |
protected boolean |
isIE9 |
protected boolean |
isIEMobile |
protected boolean |
isIMode |
protected boolean |
isIPad |
protected boolean |
isIPhone |
protected boolean |
isModernBrowser |
protected boolean |
isOldBrowser |
protected boolean |
isOpera |
protected boolean |
isOperaMini |
protected boolean |
isRobot |
protected boolean |
isSafari |
protected java.lang.String |
platform |
static java.lang.String |
REVISION |
protected java.lang.String |
userAgent
All known robot user-agent headers (list can be found
here).
|
Constructor and Description |
---|
Browser(javax.servlet.http.HttpServletRequest request,
boolean checkRemoteHost) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDevice(javax.servlet.http.HttpServletRequest request) |
static boolean |
ereg(java.lang.String regexp,
java.lang.String str) |
static boolean |
eregi(java.lang.String regexp,
java.lang.String str) |
java.lang.String |
getBrowserName() |
java.lang.String |
getBrowserShortName() |
java.lang.String |
getBrowserVersion() |
java.lang.String |
getDeviceCPU() |
int |
getDeviceScreenDepth() |
int |
getDeviceScreenHeight() |
int |
getDeviceScreenWidth() |
java.lang.String |
getPlatform() |
java.lang.String |
getUserAgent() |
static double |
getVersion(java.lang.String browserVersion) |
static void |
init(java.lang.String botPatternStr)
Initialise a Robot pattern matching a given regexp
|
boolean |
isAndroid() |
boolean |
isChrome() |
boolean |
isChromeFrame() |
boolean |
isDeviceDescribed() |
boolean |
isFirefox() |
boolean |
isIE() |
boolean |
isIE5() |
boolean |
isIE55() |
boolean |
isIE6() |
boolean |
isIE6Only() |
boolean |
isIE7() |
boolean |
isIE8() |
boolean |
isIE9() |
boolean |
isIEMobile() |
boolean |
isIMode() |
boolean |
isIPad() |
boolean |
isIPhone() |
boolean |
isKnownBrowser() |
boolean |
isModernBrowser() |
boolean |
isOldBrowser() |
boolean |
isOpera() |
boolean |
isOperaMini() |
boolean |
isPDA() |
boolean |
isRobot() |
boolean |
isSafari() |
boolean |
isSmallDevice()
Returns true if the user-client is hosted on a small device such as a PDA or an i-mode cell phone.
|
static void |
main(java.lang.String[] args) |
void |
setBrowserName(java.lang.String browserName) |
void |
setBrowserVersion(java.lang.String browserVersion) |
void |
setFirefox(boolean isFirefox) |
void |
setIE5(boolean isIE5) |
void |
setIE55(boolean isIE55) |
void |
setIMode(boolean isIMode) |
void |
setModernBrowser(boolean isModernBrowser) |
void |
setOldBrowser(boolean isOldBrowser) |
void |
setPlatform(java.lang.String platform) |
void |
setRobot(boolean isRobot) |
void |
setUserAgent(java.lang.String userAgent) |
static java.lang.String |
stristr(java.lang.String haystack,
java.lang.String needle)
Return the substring of the given haystack starting
from the first occurence of the needle
|
boolean |
supportCSS3() |
java.lang.String |
toString() |
public static final java.lang.String REVISION
protected java.lang.String userAgent
NOTE: To avoid bad detection:
protected java.lang.String platform
protected java.lang.String browserName
protected java.lang.String browserVersion
protected boolean isIE
protected boolean isIE9
protected boolean isIE8
protected boolean isIE7
protected boolean isIE6
protected boolean isIE55
protected boolean isIE5
protected boolean isIEMobile
protected boolean isFirefox
protected boolean isOpera
protected boolean isOperaMini
protected boolean isSafari
protected boolean isIPhone
protected boolean isIPad
protected boolean isBlackberry
protected boolean isAndroid
protected boolean isModernBrowser
protected boolean isOldBrowser
protected boolean isChrome
protected boolean isChromeFrame
protected boolean isRobot
protected boolean isIMode
protected static org.apache.oro.text.regex.Pattern botPattern
public static java.lang.String botPatternStr
public Browser(javax.servlet.http.HttpServletRequest request, boolean checkRemoteHost)
public static void init(java.lang.String botPatternStr)
protected void checkDevice(javax.servlet.http.HttpServletRequest request)
public java.lang.String getDeviceCPU()
public int getDeviceScreenWidth()
public int getDeviceScreenHeight()
public int getDeviceScreenDepth()
public boolean isPDA()
public boolean isSmallDevice()
public boolean isDeviceDescribed()
public static boolean eregi(java.lang.String regexp, java.lang.String str)
regexp
- the regexpstr
- the Stringpublic static boolean ereg(java.lang.String regexp, java.lang.String str)
regexp
- the regexpstr
- the Stringpublic static java.lang.String stristr(java.lang.String haystack, java.lang.String needle)
haystack
- the Stringneedle
- the first occurencepublic static double getVersion(java.lang.String browserVersion)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
public java.lang.String getBrowserName()
public void setBrowserName(java.lang.String browserName)
public java.lang.String getBrowserVersion()
public void setBrowserVersion(java.lang.String browserVersion)
public java.lang.String getBrowserShortName()
public boolean isFirefox()
public void setFirefox(boolean isFirefox)
public boolean isIE()
public boolean isIE5()
public void setIE5(boolean isIE5)
public boolean isIE55()
public void setIE55(boolean isIE55)
public boolean isIE6()
public boolean isIE6Only()
public boolean isIE7()
public boolean isIE9()
public boolean isIE8()
public boolean isIEMobile()
public boolean isChromeFrame()
public boolean isOpera()
public boolean isOperaMini()
public boolean isChrome()
public boolean isSafari()
public boolean isIPhone()
public boolean isIPad()
public boolean isAndroid()
public boolean isModernBrowser()
public void setModernBrowser(boolean isModernBrowser)
public boolean isOldBrowser()
public void setOldBrowser(boolean isOldBrowser)
public boolean isKnownBrowser()
public boolean isRobot()
public void setRobot(boolean isRobot)
public boolean isIMode()
public void setIMode(boolean isIMode)
public java.lang.String getPlatform()
public void setPlatform(java.lang.String platform)
public java.lang.String getUserAgent()
public void setUserAgent(java.lang.String userAgent)
public boolean supportCSS3()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.