public final class GWT extends Object
Constructor and Description |
---|
GWT() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
create(Class<?> classLiteral)
Instantiates a class via deferred binding.
|
static <T> T |
createImpl(Class<?> classLiteral)
Instantiates a class via deferred binding.
|
static void |
debugger()
Emits a JavaScript "debugger" statement on the line that called this method.
|
static String |
getUniqueThreadId()
Returns the empty string when running in Production Mode, but returns a
unique string for each thread in Development Mode (for example, different
windows accessing the dev mode server will each have a unique id, and
hitting refresh without restarting dev mode will result in a new unique id
for a particular window.
|
static String |
getVersion()
Get a human-readable representation of the GWT version used, or null if
this is running on the client.
|
static boolean |
isClient()
Returns
true when running inside the normal GWT environment,
either in Development Mode or Production Mode. |
static boolean |
isProdMode()
Returns
true when running in production mode. |
static boolean |
isScript()
Determines whether or not the running program is script or bytecode.
|
static void |
log(String message)
Logs a message to the development shell logger in Development Mode, or to
the JavaScript console in Super Dev Mode.
|
static void |
log(String message,
Throwable e)
Logs a message to the development shell logger in Development Mode, or to
the JavaScript console in Super Dev Mode.
|
static void |
setBridge(GWTBridge bridge)
Called via reflection in Development Mode; do not ever call this method in
Production Mode.
|
public static <T> T create(Class<?> classLiteral)
The argument to create(Class)
must be a class literal
because the Production Mode compiler must be able to statically determine
the requested type at compile-time. This can be tricky because using a
Class
variable may appear to work correctly in Development Mode.
classLiteral
- a class literal specifying the base class to be
instantiatedpublic static <T> T createImpl(Class<?> classLiteral)
classLiteral
- a class literal specifying the base class to be
instantiatedpublic static String getUniqueThreadId()
public static String getVersion()
"2.5"
public static boolean isClient()
true
when running inside the normal GWT environment,
either in Development Mode or Production Mode. Returns false
if this code is running in a plain JVM. This might happen when running
shared code on the server, or during the bootstrap sequence of a
GWTTestCase test.public static boolean isProdMode()
true
when running in production mode. Returns
false
when running either in development mode, or when running
in a plain JVM.public static boolean isScript()
public static void log(String message)
public static void log(String message, Throwable e)
public static void debugger()
public static void setBridge(GWTBridge bridge)
Copyright © 2018. All rights reserved.