public final class

WebModeClientOracle

extends ClientOracle
implements Serializable
java.lang.Object
   ↳ com.google.gwt.rpc.server.ClientOracle
     ↳ com.google.gwt.rpc.server.WebModeClientOracle

Class Overview

Encapsulates data about the structure of the client code.

Summary

Nested Classes
class WebModeClientOracle.Builder A Builder object to create ClientOracles. 
class WebModeClientOracle.Triple<A, B, C> A pair with extra data. 
Protected Constructors
WebModeClientOracle()
Instances of WebModeClientOracle are created either through the WebModeClientOracle.Builder class or via the load(InputStream) method.
Public Methods
CommandSink createCommandSink(OutputStream out)
Create a CommandSink that can encode a payload for the client.
String createUnusedIdent(String ident)
Returns an identifier that does not conflict with any symbols defined in the client.
CastableTypeData getCastableTypeData(Class<?> clazz)
Returns the Json castableType data for a given type.
String getFieldId(Class<?> clazz, String fieldName)
Given a base type and the unobfuscated field name, find the obfuscated name for the field in the client.
String getFieldId(Enum<?> value)
Return the field name for a given enum value.
String getFieldId(String className, String fieldName)
This is similar to getFieldId(Class, String) but does not search supertypes.
Pair<Class<?>, String> getFieldName(Class<?> clazz, String fieldId)
Return the name of a field from a client-side id.
String getMethodId(String className, String methodName, String... jsniArgTypes)
This is similar to #getMethodId(Class, String, Class...) but does not search supertypes.
String getMethodId(Class<?> clazz, String methodName, Class...<?> args)
This will search superclasses.
Field[] getOperableFields(Class<?> clazz)
Returns the fields of a given class that should be serialized.
int getQueryId(Class<?> clazz)
Returns the assigned castability queryId of a given type.
String getSeedName(Class<?> clazz)
Returns the name of the top-level function that is used as the seed function for a given type.
String getTypeName(String seedName)
Returns the deobfuscated name of a type based on the name of the type's seed function.
boolean isScript()
Indicates whether or not the remote client is running as compiled script.
static WebModeClientOracle load(InputStream stream)
Recreate a WebModeClientOracle based on the contents previously emitted by store(OutputStream).
void store(OutputStream stream)
Write the state of the WebModeClientOracle into an OutputStream.
[Expand]
Inherited Methods
From class com.google.gwt.rpc.server.ClientOracle
From class java.lang.Object

Protected Constructors

protected WebModeClientOracle ()

Instances of WebModeClientOracle are created either through the WebModeClientOracle.Builder class or via the load(InputStream) method.

Public Methods

public CommandSink createCommandSink (OutputStream out)

Create a CommandSink that can encode a payload for the client.

Parameters
out the OutputStream to which the output will be written
Returns
  • a CommandSink
Throws
IOException

public String createUnusedIdent (String ident)

Returns an identifier that does not conflict with any symbols defined in the client. This method does not accumulate any state.

public CastableTypeData getCastableTypeData (Class<?> clazz)

Returns the Json castableType data for a given type.

public String getFieldId (Class<?> clazz, String fieldName)

Given a base type and the unobfuscated field name, find the obfuscated name for the field in the client. This will search superclasses as well for the first matching field.

public String getFieldId (Enum<?> value)

Return the field name for a given enum value.

public String getFieldId (String className, String fieldName)

This is similar to getFieldId(Class, String) but does not search supertypes. It is intended to be used to access "magic" GWT types.

public Pair<Class<?>, String> getFieldName (Class<?> clazz, String fieldId)

Return the name of a field from a client-side id. This will search superclasses for the first instance of the named field.

Returns
  • The field's declaring class and the name of the field

public String getMethodId (String className, String methodName, String... jsniArgTypes)

This is similar to #getMethodId(Class, String, Class...) but does not search supertypes. It is intended to be used to access "magic" GWT types.

public String getMethodId (Class<?> clazz, String methodName, Class...<?> args)

This will search superclasses.

public Field[] getOperableFields (Class<?> clazz)

Returns the fields of a given class that should be serialized. This method does not crawl supertypes.

public int getQueryId (Class<?> clazz)

Returns the assigned castability queryId of a given type.

public String getSeedName (Class<?> clazz)

Returns the name of the top-level function that is used as the seed function for a given type.

public String getTypeName (String seedName)

Returns the deobfuscated name of a type based on the name of the type's seed function.

public boolean isScript ()

Indicates whether or not the remote client is running as compiled script. This may be used to optimize the payload based on assumptions that can be mode about web-mode or hosted-mode clients.

public static WebModeClientOracle load (InputStream stream)

Recreate a WebModeClientOracle based on the contents previously emitted by store(OutputStream). The underlying format should be considered opaque.

Throws
IOException

public void store (OutputStream stream)

Write the state of the WebModeClientOracle into an OutputStream. The underlying format should be considered opaque.

Throws
IOException