Package com.bfo.box

Class JsonBox


public class JsonBox extends DataBox
A "json" box contains a single JSON object. It is identical to CborBox except the value is serialized as JSON. It is defined in ISO19566-5 appendix B.4
Since:
5
  • Constructor Details

    • JsonBox

      public JsonBox()
      Create a new uninitialized box, for loading. Don't call this constructor
    • JsonBox

      public JsonBox(Json json)
      Create a new JsonBox
      Parameters:
      json - the Json object, which must not be null
  • Method Details

    • data

      public byte[] data()
      Description copied from class: DataBox
      Return a copy of the byte data from this box. Subclasses should provided more semantically-appropriate methods to retrieve data.
      Overrides:
      data in class DataBox
      Returns:
      data the data
    • setJson

      public void setJson(Json json)
      Set a new Json object to replace the one in this box
      Parameters:
      json - the Json, which must not be null
    • json

      public Json json()
      Return the Json object from this Box.
      Returns:
      the object
    • toString

      public String toString()
      Description copied from class: Box
      Return a String representation of this Box, which will be parseable as JSON
      Overrides:
      toString in class Box