Package org.zkoss.zk.device
Class AjaxDevice
- java.lang.Object
-
- org.zkoss.zk.device.GenericDevice
-
- org.zkoss.zk.device.AjaxDevice
-
- All Implemented Interfaces:
Device
public class AjaxDevice extends GenericDevice
Represents a Web browser with the Ajax support.- Since:
- 2.4.0
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description AjaxDevice()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getContentType()
Returnstext/html
java.lang.String
getDocType()
Returns<!
boolean
isCacheable()
Return false to indicate it is not cacheable.java.lang.Boolean
isCompatible(java.lang.String userAgent)
Returns null to indicate unknown.java.lang.String
packageToPath(java.lang.String pkg)
Converts a package to a path that can be accessible by the class loader (classpath).void
reloadMessages(java.util.Locale locale)
Reloads the client-side messages in the specified locale.java.lang.String
toAbsolutePath(java.lang.String path)
Converts a relative path to an absolute path that can be accessible by the class loader (classpath).-
Methods inherited from class org.zkoss.zk.device.GenericDevice
addEmbedded, getEmbedded, getServerPushClass, getType, getUnavailableMessage, init, isSupported, matches, sessionDidActivate, sessionWillPassivate, setServerPushClass, setUnavailableMessage
-
-
-
-
Method Detail
-
isCacheable
public boolean isCacheable()
Return false to indicate it is not cacheable.- Specified by:
isCacheable
in interfaceDevice
- Overrides:
isCacheable
in classGenericDevice
-
isCompatible
public java.lang.Boolean isCompatible(java.lang.String userAgent)
Description copied from class:GenericDevice
Returns null to indicate unknown. Deriving should override it to provide more precise information.- Specified by:
isCompatible
in interfaceDevice
- Overrides:
isCompatible
in classGenericDevice
- Parameters:
userAgent
- represents a client. For HTTP clients, It is the user-agent header.- Returns:
- Boolean.TRUE if this device supports the specified client, Boolean.FALSE if cannot, or null if unknown.
- See Also:
Execution.getUserAgent()
,Devices.getDeviceByClient(java.lang.String)
-
getContentType
public java.lang.String getContentType()
Returnstext/html
-
getDocType
public java.lang.String getDocType()
Returns<!DOCTYPE html>
. (since 7.0.0)- Specified by:
getDocType
in interfaceDevice
- Overrides:
getDocType
in classGenericDevice
-
packageToPath
public java.lang.String packageToPath(java.lang.String pkg)
Converts a package to a path that can be accessible by the class loader (classpath).Default: "/js/" + pkg + ".wpd";
- Specified by:
packageToPath
in interfaceDevice
- Overrides:
packageToPath
in classGenericDevice
- Since:
- 5.0.4
-
toAbsolutePath
public java.lang.String toAbsolutePath(java.lang.String path)
Converts a relative path to an absolute path that can be accessible by the class loader (classpath).Default: "/js/" + path (if path doesn't start with '/' or '~').
- Specified by:
toAbsolutePath
in interfaceDevice
- Overrides:
toAbsolutePath
in classGenericDevice
- Parameters:
path
- the path (never null). It is assumed to be a relative path if not starting with '/' or '~'.- Since:
- 5.0.4
-
reloadMessages
public void reloadMessages(java.util.Locale locale) throws java.io.IOException
Description copied from class:GenericDevice
Reloads the client-side messages in the specified locale.Default: throw UnsupportedOperationException.
- Specified by:
reloadMessages
in interfaceDevice
- Overrides:
reloadMessages
in classGenericDevice
- Parameters:
locale
- the locale. If null,Locales.getCurrent()
is assumed.- Throws:
java.io.IOException
-
-