Package org.jtester.json.encoder

Examples of org.jtester.json.encoder.JSONEncoder.encode()


    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


      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);
      }
    }
  }

  protected abstract int getArraySize(T target);
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.