public abstract class

ClientOracle

extends Object
java.lang.Object
   ↳ com.google.gwt.rpc.server.ClientOracle
Known Direct Subclasses

Class Overview

Encapsulates information about a remote client. This type is not intended to be implemented by end-users although the behavior of a concrete implementation may be modified via the DelegatingClientOracle type.

Summary

Public Methods
abstract CommandSink createCommandSink(OutputStream out)
Create a CommandSink that can encode a payload for the client.
abstract String createUnusedIdent(String ident)
Returns an identifier that does not conflict with any symbols defined in the client.
abstract CastableTypeData getCastableTypeData(Class<?> clazz)
Returns the Json castableType data for a given type.
abstract 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.
abstract String getFieldId(Enum<?> value)
Return the field name for a given enum value.
abstract String getFieldId(String className, String fieldName)
This is similar to getFieldId(Class, String) but does not search supertypes.
abstract Pair<Class<?>, String> getFieldName(Class<?> clazz, String fieldId)
Return the name of a field from a client-side id.
abstract String getMethodId(String className, String methodName, String... jsniArgTypes)
This is similar to #getMethodId(Class, String, Class...) but does not search supertypes.
abstract String getMethodId(Class<?> clazz, String methodName, Class...<?> args)
Returns the name of the top-level function which implements the named method that takes the exact arguments specified.
abstract Field[] getOperableFields(Class<?> clazz)
Returns the fields of a given class that should be serialized.
abstract int getQueryId(Class<?> clazz)
Returns the assigned castability queryId of a given type.
abstract String getSeedName(Class<?> clazz)
Returns the name of the top-level function that is used as the seed function for a given type.
abstract String getTypeName(String seedName)
Returns the deobfuscated name of a type based on the name of the type's seed function.
abstract boolean isScript()
Indicates whether or not the remote client is running as compiled script.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public abstract 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 if the CommandSink cannot write to the OutputStream

public abstract 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 abstract CastableTypeData getCastableTypeData (Class<?> clazz)

Returns the Json castableType data for a given type.

public abstract 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 abstract String getFieldId (Enum<?> value)

Return the field name for a given enum value.

public abstract 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 abstract 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 abstract 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 abstract String getMethodId (Class<?> clazz, String methodName, Class...<?> args)

Returns the name of the top-level function which implements the named method that takes the exact arguments specified. This will search in the given class as well as its supertypes.

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

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

public abstract int getQueryId (Class<?> clazz)

Returns the assigned castability queryId of a given type.

public abstract String getSeedName (Class<?> clazz)

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

public abstract String getTypeName (String seedName)

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

public abstract 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.