01: /*
02: * MyGWT Widget Library
03: * Copyright(c) 2007, MyGWT.
04: * licensing@mygwt.net
05: *
06: * http://mygwt.net/license
07: */
08: package net.mygwt.ui.client.data;
09:
10: /**
11: * A <code>DataReader</code> implementation for <code>Model</code>
12: * instances.
13: */
14: public class ModelReader implements DataReader {
15:
16: public LoadResult read(Object data) {
17: if (data instanceof LoadResult) {
18: return (LoadResult) data;
19: } else if (data instanceof DataList) {
20: LoadResult result = new LoadResult((DataList) data);
21: return result;
22: } else if (data instanceof Model) {
23: LoadResult result = new LoadResult((Model) data);
24: return result;
25: }
26: LoadResult result = new LoadResult();
27: result.success = false;
28: return result;
29: }
30:
31: }
|