当前位置: 首页>>代码示例>>Java>>正文


Java JsonValue类代码示例

本文整理汇总了Java中elemental.json.JsonValue的典型用法代码示例。如果您正苦于以下问题:Java JsonValue类的具体用法?Java JsonValue怎么用?Java JsonValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JsonValue类属于elemental.json包,在下文中一共展示了JsonValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildJson

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue buildJson() {
    JsonObject map = Json.createObject();
    putNotNull(map, "customClassOption", customClassOption);
    putNotNull(map, "customClassOptionText", customClassOptionText);
    putNotNull(map, "linkValidation", linkValidation);
    putNotNull(map, "placeholderText", placeholderText);
    putNotNull(map, "targetCheckbox", targetCheckbox);
    putNotNull(map, "targetCheckboxText", targetCheckboxText);
    return map;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:12,代码来源:Anchor.java

示例2: deserializeOps

import elemental.json.JsonValue; //导入依赖的package包/类
private List<RealtimeOperation> deserializeOps(List<Delta<String>> changes) throws DeltaRejected {
  List<RealtimeOperation> ops = new ArrayList<RealtimeOperation>();
  for (Delta<String> delta : changes) {
    RealtimeOperation op;
    try {
      JsonValue serialized = Json.instance().parse(delta.getPayload());
      op =
          transformer.createOperation(delta.getSession().userId, delta.getSession().sessionId,
              serialized);
    } catch (JsonException e) {
      throw new DeltaRejected(e);
    }
    ops.add(op);
  }
  return ops;
}
 
开发者ID:larrytin,项目名称:realtime-server-appengine,代码行数:17,代码来源:RealtimeSlobAdapter.java

示例3: buildJson

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue buildJson() {
    JsonObject map = Json.createObject();
    if (icon != null) {
        String contentFA = icon.getHtml();
        if (iconText != null) {
            contentFA += iconText;
        }
        putNotNull(map, "contentFA", contentFA);
    }
    putNotNull(map, "contentDefault", iconFallback);
    if (customTranslation) {
        putNotNull(map, "aria", aria);
    } else {
        // get buildin translations
        putNotNull(map, "aria", toolbarBuilder.getOptionsBuilder().getTranslation(aria));
    }
    putNotNull(map, "name", name);
    putNotNull(map, "action", action == null ? name : action);
    putNotNull(map, "tagNames", tagNames);
    putNotNull(map, "style", style);
    putNotNull(map, "useQueryState", useQueryState);
    putNotNull(map, "classList", classList);
    putNotNull(map, "attrs", attrs);
    return map;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:27,代码来源:ToolbarButton.java

示例4: buildJson

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue buildJson() {
    JsonObject map = Json.createObject();
    putNotNull(map, "allowMultiParagraphSelection", allowMultiParagraphSelection);
    if (buttons != null) {
        JsonArray btnList = Json.createArray();
        for (ToolbarButtonBuilder tbb : buttons) {
            btnList.set(btnList.length(), tbb.buildJson());
        }
        map.put("buttons", btnList);
    }
    putNotNull(map, "diffLeft", diffLeft);
    putNotNull(map, "diffTop", diffLeft);
    putNotNull(map, "firstButtonClass", firstButtonClass);
    putNotNull(map, "lastButtonClass", lastButtonClass);
    putNotNull(map, "standardizeSelectionStart", standardizeSelectionStart);
    putNotNull(map, "static", staticToolbar);
    // TODO relativeContainer // Toolbar is appended relative to a given DOM-Node instead of appending it to the body and position it absolute.
    //      map.put("relativeContainer", null);
    putNotNull(map, "align", align);
    putNotNull(map, "sticky", sticky);
    putNotNull(map, "stickyTopOffset", stickyTopOffset);
    putNotNull(map, "updateOnEmptySelection", updateOnEmptySelection);
    return map;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:26,代码来源:Toolbar.java

示例5: buildJson

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue buildJson() {
    JsonArray array = Json.createArray();
    for (KeyboardCommand c : commands) {
        JsonObject map = Json.createObject();
        putNotNull(map, "command", c.command);
        putNotNull(map, "key", c.key);
        putNotNull(map, "meta", c.meta);
        putNotNull(map, "shift", c.shift);
        putNotNull(map, "alt", c.alt);
        array.set(array.length(), map);
    }
    return array;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:15,代码来源:KeyboardCommands.java

示例6: encode

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue encode(final String value) {
    String result;
    switch (value) {
    case "Finished":
        result = "<div class=\"statusIconGreen\">" + FontAwesome.CHECK_CIRCLE.getHtml() + "</div>";
        break;
    case "Failed":
        result = "<div class=\"statusIconRed\">" + FontAwesome.EXCLAMATION_CIRCLE.getHtml() + "</div>";
        break;
    default:
        result = "<div class=\"statusIconActive\"></div>";
    }

    return super.encode(result);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:UploadStatusInfoWindow.java

示例7: getResult

import elemental.json.JsonValue; //导入依赖的package包/类
private JsonRpcResult getResult(JsonObject response) {
  if (!response.hasKey("result")) {
    return null;
  }

  JsonValue jsonValue = response.get("result");
  if (!jsonValue.getType().equals(ARRAY)) {
    return new JsonRpcResult(getInnerItem(jsonValue));
  }
  JsonArray jsonArray = (JsonArray) jsonValue;
  int size = jsonArray.length();
  List<Object> innerResults = new ArrayList<>(size);
  for (int i = 0; i < size; i++) {
    JsonValue innerJsonElement = jsonArray.get(i);
    Object innerItem = getInnerItem(innerJsonElement);
    innerResults.add(innerItem);
  }

  return new JsonRpcResult(innerResults);
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:ElementalJsonRpcUnmarshaller.java

示例8: getParams

import elemental.json.JsonValue; //导入依赖的package包/类
private JsonRpcParams getParams(JsonObject jsonObject) {
  if (!jsonObject.hasKey("params")) {
    return null;
  }

  JsonValue jsonValue = jsonObject.get("params");
  if (!jsonValue.getType().equals(ARRAY)) {
    return new JsonRpcParams(getInnerItem(jsonValue));
  }

  JsonArray jsonArray = (JsonArray) jsonValue;
  int size = jsonArray.length();
  List<Object> innerParameters = new ArrayList<>(size);
  for (int i = 0; i < size; i++) {
    JsonValue innerJsonElement = jsonArray.get(i);
    Object innerItem = getInnerItem(innerJsonElement);
    innerParameters.add(innerItem);
  }

  return new JsonRpcParams(innerParameters);
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:ElementalJsonRpcUnmarshaller.java

示例9: composeOne

import elemental.json.JsonValue; //导入依赖的package包/类
private <T> T composeOne(Class<T> type, Object paramObject) {
  if (paramObject instanceof JsonValue) {
    JsonValue jsonValue = (JsonValue) paramObject;
    return dtoFactory.createDtoFromJson(jsonValue.toJson(), type);
  }

  return cast(paramObject);
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:ElementalJsonRpcComposer.java

示例10: getJsonValue

import elemental.json.JsonValue; //导入依赖的package包/类
private JsonValue getJsonValue(Object param) {
  if (param == null) {
    return jsonFactory.createNull();
  }
  if (param instanceof JsonValue) {
    return cast(param);
  }
  if (param instanceof String) {
    return jsonFactory.create((String) param);
  }
  if (param instanceof Boolean) {
    return jsonFactory.create((Boolean) param);
  }
  if (param instanceof Double) {
    return jsonFactory.create((Double) param);
  }
  return jsonFactory.parse(dtoFactory.toJson(param));
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:ElementalJsonRpcMarshaller.java

示例11: buildJson

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue buildJson() {
    JsonObject map = Json.createObject();
    putNotNull(map, "hideDelay", hideDelay);
    putNotNull(map, "previewValueSelector", previewValueSelector);
    putNotNull(map, "showOnEmptyLinks", showOnEmptyLinks);
    putNotNull(map, "showWhenToolbarIsVisible", showWhenToolbarIsVisible);
    return map;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:10,代码来源:AnchorPreview.java

示例12: putNotNull

import elemental.json.JsonValue; //导入依赖的package包/类
protected void putNotNull(JsonObject obj, String key, JsonValue value) {
    if (value != null) {
        obj.put(key, value);
    }
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:6,代码来源:AbstractBuilder.java

示例13: buildJson

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue buildJson() {
    JsonObject map = Json.createObject();
    putNotNull(map, "forcePlainText", forcePlainText);
    putNotNull(map, "cleanPastedHTML", cleanPastedHTML);
    putNotNull(map, "cleanAttrs", cleanAttrs);
    putNotNull(map, "cleanTags", cleanTags);
    putNotNull(map, "unwrapTags", unwrapTags);
    return map;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:11,代码来源:PasteHandler.java

示例14: buildJson

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue buildJson() {
    JsonObject map = Json.createObject();
    putNotNull(map, "text", text);
    putNotNull(map, "hideOnClick", hideOnClick);
    return map;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:8,代码来源:Placeholder.java

示例15: encode

import elemental.json.JsonValue; //导入依赖的package包/类
@Override
public JsonValue encode(String value) {
    String newValue = null;
    if (value != null) {
        newValue = "<img src=\"data:image/png;base64," + value + "\" alt=\"\" />";
    }
    return super.encode(newValue);
}
 
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:9,代码来源:ByteArrayImageRenderer.java


注:本文中的elemental.json.JsonValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。