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 void
addPath(URL url)
void
addRef(String ref)
Object
get(String $ref)
<T> T
get(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)
void
saveOriginalRef($Ref originalRef, Object resolved)
Map<String,Object>
schema()
void
set(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.)- Returns:
- paths/URLs of all files in your schema
-
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.)
-
-