com.ivata.mask.web.browser
Class Browser

java.lang.Object
  extended bycom.ivata.mask.web.browser.Browser

public class Browser
extends java.lang.Object

This class identifies the capabilities of the web browser the client is using, from the user agent string.

LoginTag creates an instance of this class in the http session, storing it under the attribute name "browser" .

Since:
ivata masks 0.4 (2002-09-12)
Version:
$Revision: 1.2 $
Author:
Colin MacLeod colin.macleod@ivata.com

Constructor Summary
Browser(java.lang.String userAgentParam, java.lang.String javaScriptVersionParam)
           Construct an instance of the browser, using the user agent string provided to detect the browser's capabilities.
 
Method Summary
 boolean canDisplayFrames()
           Detect whether or not the browser can display frames.
 boolean canDisplayIFrames()
           Detect whether or not the browser can display <iframe&bt; tags.
 boolean canDisplayMarquee()
           Detect whether or not the browser can display <marquee&bt; tags.
 java.lang.String getJavaScriptVersion()
           A String depicting the version number of the JavaScript this browser supports if supported, otherwise null if the browser doesn't support JavaScript.
 java.lang.Integer getType()
           Identifies the make, or type of browser used (such as Mozilla, IE, etc.).
 java.lang.String getUserAgent()
           Initialized by the constructor, this is the user agent string from the request.getHeader("User-Agent") value.
 java.lang.String getVersion()
           A string depiction of the browser version number if available and known, otherwise null if the browser manufacturer could not be identified.
 boolean isJavaScriptEnabled()
           Detect whether or not this browser is capable of displaying JavaScript, and has JavaScript enabled.
 void setJavaScriptVersion(java.lang.String javaScriptVersionParam)
          Refer to getJavaScriptVersion().
 void setType(java.lang.Integer typeParam)
          Refer to getType().
 void setUserAgent(java.lang.String userAgentParam)
          Refer to getUserAgent().
 void setVersion(java.lang.String versionParam)
          Refer to getVersion().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Browser

public Browser(java.lang.String userAgentParam,
               java.lang.String javaScriptVersionParam)

Construct an instance of the browser, using the user agent string provided to detect the browser's capabilities.

Parameters:
userAgentParam - Refer to getUserAgent().
javaScriptVersionParam - Refer to getJavaScriptVersion().
Method Detail

canDisplayFrames

public final boolean canDisplayFrames()

Detect whether or not the browser can display frames.

Returns:
true if the browser can display frames, otherwise false.

canDisplayIFrames

public final boolean canDisplayIFrames()

Detect whether or not the browser can display <iframe&bt; tags.

Returns:
true if the browser can display iframes, otherwise false.

canDisplayMarquee

public final boolean canDisplayMarquee()

Detect whether or not the browser can display <marquee&bt; tags.

Returns:
true if the browser can display marquee, otherwise false.

getJavaScriptVersion

public java.lang.String getJavaScriptVersion()

A String depicting the version number of the JavaScript this browser supports if supported, otherwise null if the browser doesn't support JavaScript.

Returns:
the current value of javaScriptVersion.

getType

public java.lang.Integer getType()

Identifies the make, or type of browser used (such as Mozilla, IE, etc.). Equates to one of the constants in {@linkBrowserConstants.

Returns:
the current value of type.

getUserAgent

public java.lang.String getUserAgent()

Initialized by the constructor, this is the user agent string from the request.getHeader("User-Agent") value.

Returns:
the current value of userAgent.

getVersion

public java.lang.String getVersion()

A string depiction of the browser version number if available and known, otherwise null if the browser manufacturer could not be identified.

Returns:
the current value of version.

isJavaScriptEnabled

public boolean isJavaScriptEnabled()

Detect whether or not this browser is capable of displaying JavaScript, and has JavaScript enabled.

Returns:
true if the browser can display JavaScript, otherwise false.

setJavaScriptVersion

public final void setJavaScriptVersion(java.lang.String javaScriptVersionParam)
Refer to getJavaScriptVersion().

Parameters:
javaScriptVersionParam - Refer to getJavaScriptVersion().

setType

public final void setType(java.lang.Integer typeParam)
Refer to getType().

Parameters:
typeParam - Refer to getType().

setUserAgent

public final void setUserAgent(java.lang.String userAgentParam)
Refer to getUserAgent().

Parameters:
userAgentParam - Refer to getUserAgent().

setVersion

public final void setVersion(java.lang.String versionParam)
Refer to getVersion().

Parameters:
versionParam - Refer to getVersion().


Copyright © 2001-2005 ivata limited. All Rights Reserved.