Class JSONDecoderCache

java.lang.Object
org.webpki.json.JSONDecoderCache

public class JSONDecoderCache extends Object
Stores JSONDecoder classes for automatic instantiation during parsing. This is (sort of) an emulation of XML schema caches.

The cache system assumes that JSON documents follow a strict convention:
 
  {
      "@context": "
Message Context"
      "@qualifier": "
Message Type Qualifier"
          .
          .   
Arbitrary JSON Payload
          .
  }

Note: @qualifier is only required if multiple objects share the same @context.

A restriction imposed by this particular JSON processing model is that all properties must by default be read.

  • Field Details

  • Constructor Details

    • JSONDecoderCache

      public JSONDecoderCache()
  • Method Details

    • parse

      public JSONDecoder parse(JSONObjectReader reader)
    • parse

      public JSONDecoder parse(byte[] jsonUtf8)
    • addToCache

      public void addToCache(Class<? extends JSONDecoder> jsonDecoder)
    • addToCache

      public void addToCache(String jsonDecoderPath)
    • setCheckForUnreadProperties

      public void setCheckForUnreadProperties(boolean flag)