Package com.ibm.commons.util.io.json.util

Examples of com.ibm.commons.util.io.json.util.JsonWriter


    }
  }
 
  public String generateAsStringHier(TreeModel tree, ViewNavigator nav, boolean compact) throws NotesException, IOException {
    StringWriter sw = new StringWriter();
    JsonWriter jw = new JsonWriter(sw, compact);
    generateHier(tree, nav, jw);
    jw.flush();
    return sw.toString();
  }
View Full Code Here


  }

  @Override
  public String toJson(final boolean compact) {
    StringWriter sw = new StringWriter();
    JsonWriter jw = new JsonWriter(sw, compact);
    try {
      jw.startObject();
      jw.outStringProperty("@unid", getUniversalID());
      Set<String> keys = keySet();
      for (String key : keys) {
        Item currItem = getFirstItem(key);
        if (currItem.getMIMEEntity() == null) {
          jw.outProperty(key, currItem.getText());
        } else {
          String abstractedText = currItem.abstractText(0, false, false);
          if (null == abstractedText) {
            jw.outProperty(key, "**MIME ITEM, VALUE CANNOT BE DECODED TO JSON**");
          } else {
            jw.outProperty(key, abstractedText);
          }
        }
      }
      jw.endObject();
      jw.flush();
    } catch (IOException e) {
      DominoUtils.handleException(e, this);
      return null;
    } catch (JsonException e) {
      DominoUtils.handleException(e, this);
View Full Code Here

TOP

Related Classes of com.ibm.commons.util.io.json.util.JsonWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.