Package org.jtester.json.encoder

Examples of org.jtester.json.encoder.JSONEncoder


    if (object == null) {
      return "null";
    }

    StringWriter writer = new StringWriter();
    JSONEncoder encoder = JSONEncoder.get(object.getClass());
    encoder.setFeatures(features);

    List<String> references = new ArrayList<String>();
    encoder.encode(object, writer, references);
    String json = writer.toString();
    return json;
  }
View Full Code Here


        writer.append(',');
      }
      Object item = it.next();
      boolean isNullOrRef = this.writerNullOrReference(item, writer, references, false);
      if (isNullOrRef == false) {
        JSONEncoder baseEncoder = JSONEncoder.get(item.getClass());
        baseEncoder.setFeatures(this.features);
        baseEncoder.encode(item, writer, references);
      }
    }
  }
View Full Code Here

      }

      Object item = this.getItemByIndex(target, index);
      boolean isNullOrRef = this.writerNullOrReference(item, writer, references, false);
      if (isNullOrRef == false) {
        JSONEncoder baseEncoder = this.getEncoderByItem(item);
        baseEncoder.setFeatures(this.features);
        baseEncoder.encode(item, writer, references);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.jtester.json.encoder.JSONEncoder

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.