com.smartgwt.client.types

## Enum DSDataFormat

- java.lang.Object
- - java.lang.Enum<DSDataFormat>
  - - com.smartgwt.client.types.DSDataFormat

- All Implemented Interfaces:
    ValueEnum, java.io.Serializable, java.lang.Comparable<DSDataFormat>

      public enum DSDataFormat
      extends java.lang.Enum<DSDataFormat>
      implements ValueEnum

  Indicates the format to be used for HTTP requests and responses when fulfilling DSRequests (eg, when `DataSource.fetchData()` is called).

  Note that `request queuing` is only available for "iscServer" requests.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CUSTOM` Smart GWT will not attempt to parse the response, instead, `DataSource.transformResponse()` must be implemented.
    `ISCSERVER` Make an HTTP request in a format recognized by the ISC server and expect ISC server response format.
    `JSON` Expect response in JSON (Java Script Object Notation) format, ready to be eval()'d.
    `XML` Expect XML responses.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getValue()`
    `static DSDataFormat` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static DSDataFormat[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### ISCSERVER

          public static final DSDataFormat ISCSERVER

      Make an HTTP request in a format recognized by the ISC server and expect ISC server response format. `Server-side integration` can then be used to connect to any kind of data store or web service.

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "iscServer".

    - #### XML

          public static final DSDataFormat XML

      Expect XML responses. Request format depends on the setting for `protocol`. This is the correct setting when consuming RSS feeds, XML web services (whether SOAP, REST, XML-RPC or custom format), and XML flat files directly from the browser.

      Values for "date", "time" or "datetime" fields in responses should be specified in the applicable XML Schema date format. If no timezone is explicitly specified, dates / datetimes received by the client are assumed to be GMT. Note that "date" type fields represent logical dates and may omit time information entirely, and "time" type fields may omit date information. See `Date and Time Format and storage` for more information on how date values are serialized in requests sent to the server.

      A DSResponse will be derived from the returned XML via the process described under `DataSource.transformResponse()`.

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "xml".

    - #### JSON

          public static final DSDataFormat JSON

      Expect response in JSON (Java Script Object Notation) format, ready to be eval()'d. Response should either be a naked object literal:

            { "property":"value1", "property2" : "value2", ... }

      or a string that evals to return a valid response object:

            var response = { "property":"value1", "property2" : "value2", ... }
            response;

      A DSResponse will be derived from the returned JSON via the process described under `DataSource.transformResponse()`.

      As with `"xml"` responses, values for "date" or "datetime" fields should be specified as a String in XML Schema date format and may include a timezone. In the absence of a timezone they will be assumed to be GMT.

      Request format depends on the setting for `protocol`. See also `XJSONDataSource`.

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "json".

    - #### CUSTOM

          public static final DSDataFormat CUSTOM

      Smart GWT will not attempt to parse the response, instead, `DataSource.transformResponse()` must be implemented. `transformResponse` will receive the "data" parameter as a String, and must parse this String into an Array of Objects, which should be set as `DSResponse.data`. Request format depends on the setting for `protocol`.

      Note that, unlike either the "json" or "xml" settings of `dataFormat`, you are responsible for ensuring that parsed values are the correct type, for example, using the JavaScript built-ins `parseInt` and `parseFloat` on integer and decimal values respectively, and using `new Date()` to construct valid Dates.

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "custom".

  - ### Method Detail

    - #### values

          public static DSDataFormat[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (DSDataFormat c : DSDataFormat.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static DSDataFormat valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getValue

          public java.lang.String getValue()

      Specified by:
        `getValue` in interface `ValueEnum`