org.millstone.webadapter
Class WebBrowser

java.lang.Object
  |
  +--org.millstone.webadapter.WebBrowser
All Implemented Interfaces:
Terminal

public class WebBrowser
extends java.lang.Object
implements Terminal

Web browser terminal type. This class implements web browser properties, which declare the features of the web browser.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Nested Class Summary
 class WebBrowser.JavaScriptVersion
           
 class WebBrowser.MarkupVersion
           
 
Field Summary
static WebBrowser.JavaScriptVersion ECMA_262
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_0
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_1
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_2
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_3
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_4
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_5
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_NONE
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_UNCHECKED
           
static WebBrowser.JavaScriptVersion[] JAVASCRIPT_VERSIONS
           
static WebBrowser.JavaScriptVersion JSCRIPT_1_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_3_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_4_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_1
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_5
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_6
           
static WebBrowser.MarkupVersion MARKUP_HTML_2_0
           
static WebBrowser.MarkupVersion MARKUP_HTML_3_2
           
static WebBrowser.MarkupVersion MARKUP_HTML_4_0
           
static WebBrowser.MarkupVersion MARKUP_UNKNOWN
           
static WebBrowser.MarkupVersion[] MARKUP_VERSIONS
           
static WebBrowser.MarkupVersion MARKUP_WML_1_0
           
static WebBrowser.MarkupVersion MARKUP_WML_1_1
           
static WebBrowser.MarkupVersion MARKUP_WML_1_2
           
static WebBrowser.MarkupVersion MARKUP_XHTML_1_0
           
static WebBrowser.MarkupVersion MARKUP_XHTML_2_0
           
 
Constructor Summary
WebBrowser()
          Constructor WebBrowserType.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Test the equality of the properties for two web browser types
 java.lang.String getBrowserApplication()
          Get the name and version of the web browser application.
 java.lang.String getContentType()
          Get preferred content type
 java.util.Locale getDefaultLocale()
          Get the default locale requested by the browser.
 java.lang.String getDefaultTheme()
          Get name of the default theme
 WebBrowser.JavaScriptVersion getJavaScriptVersion()
          Get the version of the supported Java Script by the browser.
 java.util.Collection getLocales()
          Returns the locales supported by the web browser.
 WebBrowser.MarkupVersion getMarkupVersion()
          Get the supported markup language.
 int getScreenHeight()
          Get height of the terminal window in pixels
 int getScreenWidth()
          Get width of the terminal window in pixels
 int hashCode()
          Hash code composed of the properties of the web browser type
 boolean isClientSideChecked()
          Get the client side cheked property.
 boolean isFrameSupport()
          Does the browser support frames ?
 boolean isJavaEnabled()
          Check if web browser supports Java.
static WebBrowser.MarkupVersion parseHTMLVersion(java.lang.String html)
          Parse HTML version from string.
static WebBrowser.JavaScriptVersion parseJavaScriptVersion(java.lang.String js)
          Parse JavaScript version from string.
 boolean performClientCheck()
          Should the client features be checked using remote scripts.
 void performClientCheck(boolean value)
          Should the client features be checked using remote scripts.
 void setBrowserApplication(java.lang.String browserApplication)
          Sets the browser application.
 void setClientSideChecked(boolean value)
          Set the client side checked property.
 void setContentType(java.lang.String contentType)
          Sets the default content type.
 void setFrameSupport(boolean frameSupport)
          Set the browser frame support
 void setJavaEnabled(boolean javaEnabled)
          Sets the java enabled property.
 void setJavaScriptVersion(WebBrowser.JavaScriptVersion javaScriptVersion)
          Sets the JavaScript version.
 void setMarkupVersion(WebBrowser.MarkupVersion markupVersion)
          Sets the markup language version.
 void setScreenHeight(int screenHeight)
          Sets the screen height.
 void setScreenWidth(int screenWidth)
          Sets the screen width.
 boolean supports(java.lang.String browser)
          Check if this type supports also given browser.
 boolean supports(WebBrowser.JavaScriptVersion js)
          Check if this type supports given javascript version.
 boolean supports(WebBrowser.MarkupVersion html)
          Check if this type supports given markup language version.
 java.lang.String toString()
          Repsent the type of the web browser as string
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MARKUP_UNKNOWN

public static final WebBrowser.MarkupVersion MARKUP_UNKNOWN

MARKUP_HTML_2_0

public static final WebBrowser.MarkupVersion MARKUP_HTML_2_0

MARKUP_HTML_3_2

public static final WebBrowser.MarkupVersion MARKUP_HTML_3_2

MARKUP_HTML_4_0

public static final WebBrowser.MarkupVersion MARKUP_HTML_4_0

MARKUP_XHTML_1_0

public static final WebBrowser.MarkupVersion MARKUP_XHTML_1_0

MARKUP_XHTML_2_0

public static final WebBrowser.MarkupVersion MARKUP_XHTML_2_0

MARKUP_WML_1_0

public static final WebBrowser.MarkupVersion MARKUP_WML_1_0

MARKUP_WML_1_1

public static final WebBrowser.MarkupVersion MARKUP_WML_1_1

MARKUP_WML_1_2

public static final WebBrowser.MarkupVersion MARKUP_WML_1_2

MARKUP_VERSIONS

public static final WebBrowser.MarkupVersion[] MARKUP_VERSIONS

JAVASCRIPT_UNCHECKED

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_UNCHECKED

JAVASCRIPT_NONE

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_NONE

JAVASCRIPT_1_0

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_0

JAVASCRIPT_1_1

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_1

JAVASCRIPT_1_2

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_2

JAVASCRIPT_1_3

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_3

JAVASCRIPT_1_4

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_4

JAVASCRIPT_1_5

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_5

JSCRIPT_1_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_1_0

JSCRIPT_3_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_3_0

JSCRIPT_4_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_4_0

JSCRIPT_5_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_0

JSCRIPT_5_1

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_1

JSCRIPT_5_5

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_5

JSCRIPT_5_6

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_6

ECMA_262

public static final WebBrowser.JavaScriptVersion ECMA_262

JAVASCRIPT_VERSIONS

public static final WebBrowser.JavaScriptVersion[] JAVASCRIPT_VERSIONS
Constructor Detail

WebBrowser

public WebBrowser()
Constructor WebBrowserType. Creates default WebBrowserType instance.

Method Detail

getDefaultTheme

public java.lang.String getDefaultTheme()
Get name of the default theme

Specified by:
getDefaultTheme in interface Terminal
Returns:
Name of the terminal window

getBrowserApplication

public java.lang.String getBrowserApplication()
Get the name and version of the web browser application. This is the version string reported by the web-browser in http headers.

Returns:
Web browser application.

getJavaScriptVersion

public WebBrowser.JavaScriptVersion getJavaScriptVersion()
Get the version of the supported Java Script by the browser. Null if the Java Script is not supported.

Returns:
Version of the supported Java Script

isFrameSupport

public boolean isFrameSupport()
Does the browser support frames ?

Returns:
True if the browser supports frames, False if not

setFrameSupport

public void setFrameSupport(boolean frameSupport)
Set the browser frame support

Parameters:
frameSupport - True if the browser supports frames, False if not

getMarkupVersion

public WebBrowser.MarkupVersion getMarkupVersion()
Get the supported markup language.

Returns:
Supported markup language

getScreenHeight

public int getScreenHeight()
Get height of the terminal window in pixels

Specified by:
getScreenHeight in interface Terminal
Returns:
Height of the terminal window

getScreenWidth

public int getScreenWidth()
Get width of the terminal window in pixels

Specified by:
getScreenWidth in interface Terminal
Returns:
Width of the terminal window

getDefaultLocale

public java.util.Locale getDefaultLocale()
Get the default locale requested by the browser.

Returns:
Default locale

hashCode

public int hashCode()
Hash code composed of the properties of the web browser type

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Test the equality of the properties for two web browser types

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Repsent the type of the web browser as string

Overrides:
toString in class java.lang.Object

getContentType

public java.lang.String getContentType()
Get preferred content type


supports

public boolean supports(java.lang.String browser)
Check if this type supports also given browser.

Returns:
true if this type matches the given browser.

supports

public boolean supports(WebBrowser.MarkupVersion html)
Check if this type supports given markup language version.

Returns:
true if this type supports the given markup version.

supports

public boolean supports(WebBrowser.JavaScriptVersion js)
Check if this type supports given javascript version.

Parameters:
js - The javascript version to check for.
Returns:
true if this type supports the given javascript version.

parseHTMLVersion

public static WebBrowser.MarkupVersion parseHTMLVersion(java.lang.String html)
Parse HTML version from string.

Returns:
HTMLVersion instance.

parseJavaScriptVersion

public static WebBrowser.JavaScriptVersion parseJavaScriptVersion(java.lang.String js)
Parse JavaScript version from string.

Returns:
HTMLVersion instance.

isClientSideChecked

public boolean isClientSideChecked()
Get the client side cheked property. Certain terminal features can only be detected at client side. This property indicates if the client side detections have been performed for this type.

Returns:
true if client has sent information about its properties. Default false

setClientSideChecked

public void setClientSideChecked(boolean value)
Set the client side checked property. Certain terminal features can only be detected at client side. This property indicates if the client side detections have been performed for this type.


performClientCheck

public boolean performClientCheck()
Should the client features be checked using remote scripts. Should the client side terminal feature check be performed.

Returns:
true if client side checking should be performed for this terminal type. Default false.

performClientCheck

public void performClientCheck(boolean value)
Should the client features be checked using remote scripts.

Returns:
true if client side checking should be performed for this terminal type. Default false.

isJavaEnabled

public boolean isJavaEnabled()
Check if web browser supports Java.

Returns:
boolean

getLocales

public java.util.Collection getLocales()
Returns the locales supported by the web browser.

Returns:
Collection

setBrowserApplication

public void setBrowserApplication(java.lang.String browserApplication)
Sets the browser application. This corresponds to User-Agent HTTP header.

Parameters:
browserApplication - The browserApplication to set

setContentType

public void setContentType(java.lang.String contentType)
Sets the default content type. Default is text/html

Parameters:
contentType - The contentType to set

setJavaEnabled

public void setJavaEnabled(boolean javaEnabled)
Sets the java enabled property.

Parameters:
javaEnabled - The javaEnabled to set

setJavaScriptVersion

public void setJavaScriptVersion(WebBrowser.JavaScriptVersion javaScriptVersion)
Sets the JavaScript version.

Parameters:
javaScriptVersion - The JavaScript version to set

setMarkupVersion

public void setMarkupVersion(WebBrowser.MarkupVersion markupVersion)
Sets the markup language version.

Parameters:
markupVersion - ersion The markup language version to set

setScreenHeight

public void setScreenHeight(int screenHeight)
Sets the screen height.

Parameters:
screenHeight - The screen height to set in pixels.

setScreenWidth

public void setScreenWidth(int screenWidth)
Sets the screen width.

Parameters:
screenWidth - The screenWidth to set in pixels.


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.