Package io.zenwave360.jsonrefparser
Class $Refs
- java.lang.Object
-
- io.zenwave360.jsonrefparser.$Refs
-
public class $Refs extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPath(URL url)voidaddRef(String ref)Objectget(String $ref)<T> Tget(String $ref, Class<T> type)List<String>paths(String... types)Returns the paths/URLs of all the files in your schema (including the main schema file).List<String>refs(String... types)voidsaveOriginalRef($Ref originalRef, Object resolved)Map<String,Object>schema()voidset(String $ref, Object value)Sets the value at the given path in the schema.
-
-
-
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)
-
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.)
-
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 hashvalue- The value to assign. Can be anything (object, string, number, etc.)
-
-