Class $Refs


  • public class $Refs
    extends Object
    • Field Detail

      • circular

        public boolean circular
      • jsonContext

        public com.jayway.jsonpath.internal.JsonContext jsonContext
      • file

        public final URL file
      • rootDir

        public final URL rootDir
    • Constructor Detail

      • $Refs

        public $Refs​(com.jayway.jsonpath.internal.JsonContext jsonContext)
      • $Refs

        public $Refs​(com.jayway.jsonpath.internal.JsonContext jsonContext,
                     URL file)
    • Method Detail

      • addRef

        public void addRef​(String ref)
      • addPath

        public void addPath​(URL url)
      • saveOriginalRef

        public void saveOriginalRef​($Ref originalRef,
                                    Object resolved)
      • paths

        public List<String> paths​(String... types)
        Returns the paths/URLs of all the files in your schema (including the main schema file).
        Parameters:
        types - (optional) Optionally only return certain types of paths ("file", "http", etc.)
        Returns:
        paths/URLs of all files in your schema
      • get

        public <T> T get​(String $ref,
                         Class<T> type)
      • set

        public void set​(String $ref,
                        Object value)
        Sets the value at the given path in the schema. If the property, or any of its parents, don't exist, they will be created.
        Parameters:
        $ref - The JSON Reference path, optionally with a JSON Pointer in the hash
        value - The value to assign. Can be anything (object, string, number, etc.)