Skip to content

DataAPI SDK japanese MT.DataAPI Static method registerFormat

Taku AMANO edited this page Jul 5, 2013 · 4 revisions

registerFormat

Register formats that serialize data.

パラメータ

パラメータ名 タイプ 必須 説明
key String * Format name
spec Object * Format spec
spec.fileExtension String * Extension
spec.mimeType String * MIME type
spec.serialize String *
spec.unserialize String *

DataAPI.registerFormat("json", {
  fileExtension: 'json',
  mimeType: 'application/json',
  serialize: function() {
      return JSON.stringify.apply(JSON, arguments);
  },
  unserialize: function() {
      return JSON.parse.apply(JSON, arguments);
  }
});

Clone this wiki locally