| 1 | define([ |
| 2 | "dojo/_base/lang" |
| 3 | ], function(lang){ |
| 4 | |
| 5 | // module: |
| 6 | // dojox/mobile/dh/ContentTypeMap |
| 7 | |
| 8 | var o = { |
| 9 | // summary: |
| 10 | // A component that provides a map for determining the content handler |
| 11 | // class from a content-type. |
| 12 | }; |
| 13 | lang.setObject("dojox.mobile.dh.ContentTypeMap", o); |
| 14 | |
| 15 | o.map = { |
| 16 | "html": "dojox/mobile/dh/HtmlContentHandler", |
| 17 | "json": "dojox/mobile/dh/JsonContentHandler" |
| 18 | }; |
| 19 | |
| 20 | o.add = function(/*String*/ contentType, /*String*/ handlerClass){ |
| 21 | // summary: |
| 22 | // Adds a handler class for the given content type. |
| 23 | this.map[contentType] = handlerClass; |
| 24 | }; |
| 25 | |
| 26 | o.getHandlerClass = function(/*String*/ contentType){ |
| 27 | // summary: |
| 28 | // Returns the handler class for the given content type. |
| 29 | return this.map[contentType]; |
| 30 | }; |
| 31 | |
| 32 | return o; |
| 33 | }); |