Class AdvancedJsonSchemaLoader

  • All Implemented Interfaces:
    JsonSchemaLoader

    public class AdvancedJsonSchemaLoader
    extends java.lang.Object
    implements JsonSchemaLoader
    JsonSchemaLoader implementation that allows for more settings.

    If you have a schema defined such that supporting files for your schema are only available on the classpath, rather than as a file:// or http:// URL. :

     
        {
          "type": "array",
          "items": {
              "$ref": "classpath://com/adaptris/core/json/schema/test_schema.json"
          }
         }
     
     
    then you need to enable the classpath aware functionality of the schema builder; this is disabled by default with the expectation that generally either all schemas as self-contained, or they are available explicitly as a standard URL resource.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Boolean getClassPathAwareClient()
      Returns whether or not to enable the classpath aware functionality of the schema builder.
      java.lang.String getResolutionScope()
      The initial resolution scope of the schema.
      org.everit.json.schema.Schema loadSchema​(org.json.JSONObject rawSchema)
      Provide a JSON Schema based on the JSONObject parameter.
      void setClassPathAwareClient​(java.lang.Boolean classPathAwareClient)
      Toggle the classpath aware functionality of the schema builder.
      void setResolutionScope​(java.lang.String resolutionScope)
      Sets the initial resolution scope of the schema.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AdvancedJsonSchemaLoader

        public AdvancedJsonSchemaLoader()
    • Method Detail

      • loadSchema

        public org.everit.json.schema.Schema loadSchema​(org.json.JSONObject rawSchema)
        Description copied from interface: JsonSchemaLoader
        Provide a JSON Schema based on the JSONObject parameter.
        Specified by:
        loadSchema in interface JsonSchemaLoader
        Parameters:
        rawSchema - JSONObject to load as Schema.
        Returns:
        Schema based on JSONObject.
      • setClassPathAwareClient

        public void setClassPathAwareClient​(java.lang.Boolean classPathAwareClient)
        Toggle the classpath aware functionality of the schema builder.
        Parameters:
        classPathAwareClient - control classpath aware functionality
      • getClassPathAwareClient

        public java.lang.Boolean getClassPathAwareClient()
        Returns whether or not to enable the classpath aware functionality of the schema builder.
        Returns:
        whether or not to enable the classpath aware functionality
      • setResolutionScope

        public void setResolutionScope​(java.lang.String resolutionScope)
        Sets the initial resolution scope of the schema.
        Parameters:
        resolutionScope - the initial (absolute) URI, used as the resolution scope.
      • getResolutionScope

        public java.lang.String getResolutionScope()
        The initial resolution scope of the schema.
        Returns:
        The (absolute) URI, used as the resolution scope.