Interface IJsonIO

    • Method Detail

      • write

        static <E extends IJsonIO> void write​(E obj,
                                              Bindings bindings)
      • load

        default void load​(Bindings bindings)
        Implement this method to control loading from the Json bindings. The default behavior simply loads values corresponding with your class's field values.

        The bindings is just a simple map with name value pairs, which usually maps directly to your class's fields. But anything goes; you can read and write anything from/to the Bindings.

        Use #read() etc. to read proper Json data.

        Parameters:
        bindings -
      • save

        default void save​(Bindings bindings)
        Implement this method to control saving to a Json bindings. The default behavior simply saves all your class's non-transient instance fields.

        Basically, the bindings is a simple map where you write name/value pairs representing your class's format. Typically you save just your field values, but you can save anything you like.

        Use #write(String, Object, Bindings) etc. to write proper Json data.

        Parameters:
        bindings -
      • isSimpleType

        static boolean isSimpleType​(Object value)
      • isSimpleType

        static boolean isSimpleType​(Class cls)