com.google.gwt.rpc.server

## Class ClientOracle

- java.lang.Object
- - com.google.gwt.rpc.server.ClientOracle

- Direct Known Subclasses:
    DelegatingClientOracle, HostedModeClientOracle, WebModeClientOracle

      public abstract class ClientOracle
      extends java.lang.Object

  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.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientOracle()` Not a generally-extensible class.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract com.google.gwt.rpc.client.ast.CommandSink` | `createCommandSink(java.io.OutputStream out)` Create a CommandSink that can encode a payload for the client.
    `abstract java.lang.String` | `createUnusedIdent(java.lang.String ident)` Returns an identifier that does not conflict with any symbols defined in the client.
    `abstract CastableTypeData` | `getCastableTypeData(java.lang.Class<?> clazz)` Returns the Json castableType data for a given type.
    `abstract java.lang.String` | `getFieldId(java.lang.Class<?> clazz, java.lang.String fieldName)` Given a base type and the unobfuscated field name, find the obfuscated name for the field in the client.
    `abstract java.lang.String` | `getFieldId(java.lang.Enum<?> value)` Return the field name for a given enum value.
    `abstract java.lang.String` | `getFieldId(java.lang.String className, java.lang.String fieldName)` This is similar to `getFieldId(Class, String)` but does not search supertypes.
    `abstract Pair<java.lang.Class<?>,java.lang.String>` | `getFieldName(java.lang.Class<?> clazz, java.lang.String fieldId)` Return the name of a field from a client-side id.
    `abstract java.lang.String` | `getMethodId(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>... args)` Returns the name of the top-level function which implements the named method that takes the exact arguments specified.
    `abstract java.lang.String` | `getMethodId(java.lang.String className, java.lang.String methodName, java.lang.String... jsniArgTypes)` This is similar to `getMethodId(Class, String, Class...)` but does not search supertypes.
    `abstract java.lang.reflect.Field[]` | `getOperableFields(java.lang.Class<?> clazz)` Returns the fields of a given class that should be serialized.
    `abstract int` | `getQueryId(java.lang.Class<?> clazz)` Returns the assigned castability queryId of a given type.
    `abstract java.lang.String` | `getSeedName(java.lang.Class<?> clazz)` Returns the name of the top-level function that is used as the seed function for a given type.
    `abstract java.lang.String` | `getTypeName(java.lang.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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ClientOracle

          ClientOracle()

      Not a generally-extensible class.

  - ### Method Detail

    - #### createCommandSink

          public abstract com.google.gwt.rpc.client.ast.CommandSink createCommandSink(java.io.OutputStream out)
                                                                               throws java.io.IOException

      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:
        `java.io.IOException` - if the CommandSink cannot write to the OutputStream

    - #### createUnusedIdent

          public abstract java.lang.String createUnusedIdent(java.lang.String ident)

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

    - #### getCastableTypeData

          public abstract CastableTypeData getCastableTypeData(java.lang.Class<?> clazz)

      Returns the Json castableType data for a given type.

    - #### getFieldId

          public abstract java.lang.String getFieldId(java.lang.Class<?> clazz,
                                    java.lang.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.

    - #### getFieldId

          public abstract java.lang.String getFieldId(java.lang.Enum<?> value)

      Return the field name for a given enum value.

    - #### getFieldId

          public abstract java.lang.String getFieldId(java.lang.String className,
                                    java.lang.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.

    - #### getFieldName

          public abstract Pair<java.lang.Class<?>,java.lang.String> getFieldName(java.lang.Class<?> clazz,
                                                               java.lang.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

    - #### getMethodId

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

    - #### getMethodId

          public abstract java.lang.String getMethodId(java.lang.String className,
                                     java.lang.String methodName,
                                     java.lang.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.

    - #### getOperableFields

          public abstract java.lang.reflect.Field[] getOperableFields(java.lang.Class<?> clazz)

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

    - #### getQueryId

          public abstract int getQueryId(java.lang.Class<?> clazz)

      Returns the assigned castability queryId of a given type.

    - #### getSeedName

          public abstract java.lang.String getSeedName(java.lang.Class<?> clazz)

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

    - #### getTypeName

          public abstract java.lang.String getTypeName(java.lang.String seedName)

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

    - #### isScript

          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.