Package com.orientechnologies.orient.core.serialization.serializer

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.writeAttribute()


            keepTypes, 0, -1, parsedRecords);
      } else if (iRecord instanceof ORecordStringable) {

        // STRINGABLE
        final ORecordStringable record = (ORecordStringable) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", record.value());

      } else if (iRecord instanceof ORecordBytes) {
        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
View Full Code Here


        json.writeAttribute(indentLevel + 1, true, "value", record.value());

      } else if (iRecord instanceof ORecordBytes) {
        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");
View Full Code Here

      if (db.getStorage() instanceof OStorageLocal) {
        json.beginCollection(1, false, "dataSegments");
        for (ODataLocal data : ((OStorageLocal) db.getStorage()).getDataSegments()) {
          json.beginObject(2, true, null);
          json.writeAttribute(3, false, "id", data.getId());
          json.writeAttribute(3, false, "name", data.getName());
          json.writeAttribute(3, false, "size", data.getSize());
          json.writeAttribute(3, false, "filled", data.getFilledUpTo());
          json.writeAttribute(3, false, "maxSize", data.getConfig().maxSize);
          json.writeAttribute(3, false, "files", Arrays.toString(data.getConfig().infoFiles));
View Full Code Here

      if (db.getStorage() instanceof OStorageLocal) {
        json.beginCollection(1, false, "dataSegments");
        for (ODataLocal data : ((OStorageLocal) db.getStorage()).getDataSegments()) {
          json.beginObject(2, true, null);
          json.writeAttribute(3, false, "id", data.getId());
          json.writeAttribute(3, false, "name", data.getName());
          json.writeAttribute(3, false, "size", data.getSize());
          json.writeAttribute(3, false, "filled", data.getFilledUpTo());
          json.writeAttribute(3, false, "maxSize", data.getConfig().maxSize);
          json.writeAttribute(3, false, "files", Arrays.toString(data.getConfig().infoFiles));
          json.endObject(2, false);
View Full Code Here

        json.beginCollection(1, false, "dataSegments");
        for (ODataLocal data : ((OStorageLocal) db.getStorage()).getDataSegments()) {
          json.beginObject(2, true, null);
          json.writeAttribute(3, false, "id", data.getId());
          json.writeAttribute(3, false, "name", data.getName());
          json.writeAttribute(3, false, "size", data.getSize());
          json.writeAttribute(3, false, "filled", data.getFilledUpTo());
          json.writeAttribute(3, false, "maxSize", data.getConfig().maxSize);
          json.writeAttribute(3, false, "files", Arrays.toString(data.getConfig().infoFiles));
          json.endObject(2, false);
        }
View Full Code Here

        for (ODataLocal data : ((OStorageLocal) db.getStorage()).getDataSegments()) {
          json.beginObject(2, true, null);
          json.writeAttribute(3, false, "id", data.getId());
          json.writeAttribute(3, false, "name", data.getName());
          json.writeAttribute(3, false, "size", data.getSize());
          json.writeAttribute(3, false, "filled", data.getFilledUpTo());
          json.writeAttribute(3, false, "maxSize", data.getConfig().maxSize);
          json.writeAttribute(3, false, "files", Arrays.toString(data.getConfig().infoFiles));
          json.endObject(2, false);
        }
        json.endCollection(1, true);
View Full Code Here

          json.beginObject(2, true, null);
          json.writeAttribute(3, false, "id", data.getId());
          json.writeAttribute(3, false, "name", data.getName());
          json.writeAttribute(3, false, "size", data.getSize());
          json.writeAttribute(3, false, "filled", data.getFilledUpTo());
          json.writeAttribute(3, false, "maxSize", data.getConfig().maxSize);
          json.writeAttribute(3, false, "files", Arrays.toString(data.getConfig().infoFiles));
          json.endObject(2, false);
        }
        json.endCollection(1, true);
      }
View Full Code Here

          json.writeAttribute(3, false, "id", data.getId());
          json.writeAttribute(3, false, "name", data.getName());
          json.writeAttribute(3, false, "size", data.getSize());
          json.writeAttribute(3, false, "filled", data.getFilledUpTo());
          json.writeAttribute(3, false, "maxSize", data.getConfig().maxSize);
          json.writeAttribute(3, false, "files", Arrays.toString(data.getConfig().infoFiles));
          json.endObject(2, false);
        }
        json.endCollection(1, true);
      }
View Full Code Here

        for (String clusterName : db.getClusterNames()) {
          cluster = ((OStorageEmbedded) db.getStorage()).getClusterById(db.getClusterIdByName(clusterName));

          try {
            json.beginObject(2, true, null);
            json.writeAttribute(3, false, "id", cluster.getId());
            json.writeAttribute(3, false, "name", clusterName);
            json.writeAttribute(3, false, "type", cluster.getType());
            json.writeAttribute(3, false, "records", cluster.getEntries());
            if (cluster instanceof OClusterLocal) {
              json.writeAttribute(3, false, "size", ((OClusterLocal) cluster).getSize());
View Full Code Here

          cluster = ((OStorageEmbedded) db.getStorage()).getClusterById(db.getClusterIdByName(clusterName));

          try {
            json.beginObject(2, true, null);
            json.writeAttribute(3, false, "id", cluster.getId());
            json.writeAttribute(3, false, "name", clusterName);
            json.writeAttribute(3, false, "type", cluster.getType());
            json.writeAttribute(3, false, "records", cluster.getEntries());
            if (cluster instanceof OClusterLocal) {
              json.writeAttribute(3, false, "size", ((OClusterLocal) cluster).getSize());
              json.writeAttribute(3, false, "filled", ((OClusterLocal) cluster).getFilledUpTo());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.