@Override
  public ReferenceGenome convertModelValue(Splittable object) {
    if (object == null) {
      return null;
    }
    if (!object.isKeyed()) {
      return null;
    }

    AutoBean<ReferenceGenome> ab = AutoBeanCodex.decode(factory, ReferenceGenome.class, object);
    return ab.as();
  }
 /**
  * @param selection a splittable which this function assumes is a list of {@link SelectionItem}s
  */
 public void setSelection(Splittable selection) {
   selectionItemsEditor.setSuppressEvent(true);
   AppTemplateAutoBeanFactory factory = GWT.create(AppTemplateAutoBeanFactory.class);
   SelectionItemList siList =
       AutoBeanCodex.decode(
               factory,
               SelectionItemList.class,
               "{\"selectionItems\": " + selection.getPayload() + "}")
           .as();
   List<SelectionItem> items = siList.getSelectionItems();
   tree.setSelection(items);
   selectionItemsEditor.setSuppressEvent(false);
 }
 @Override
 protected Counts convertFrom(final String json) {
   return AutoBeanCodex.decode(factory, Counts.class, json).as();
 }
 public <T> T decode(Class<T> clazz, String json) {
   AutoBean<T> bean = AutoBeanCodex.decode(messageFactory, clazz, json);
   return bean.as();
 }
Beispiel #5
0
 private IResponse decodeJSON(String json) {
   IResponseFactory factory = GWT.create(IResponseFactory.class);
   AutoBean<IResponse> bean = AutoBeanCodex.decode(factory, IResponse.class, json);
   return bean.as();
 }