Class JSONSerializer

java.lang.Object
de.ralleytn.simple.json.serialization.JSONSerializer

public final class JSONSerializer extends Object
Provides static methods which allow you to convert Java objects into JSONObjects and the other way around.
Since:
1.0.0
Version:
2.1.0
Author:
Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
  • Method Details

    • deserialize

      public static final void deserialize(JSONObject json, Object object) throws Exception
      Transfers the data of JSONObject into a Java object.
      Parameters:
      json - the JSON object containing the data
      object - the body of the Java object that should be filled
      Throws:
      Exception - if an error occurs
      Since:
      1.0.0
    • serialize

      public static final JSONObject serialize(Object object) throws Exception
      Converts a Java object into a JSONObject.
      Parameters:
      object - the Java object you want to convert
      Returns:
      the resulting JSONObject
      Throws:
      Exception - if an error occurs
      Since:
      1.0.0