Package io.zenwave360.jsonrefparser
Class $Refs
- java.lang.Object
-
- io.zenwave360.jsonrefparser.$Refs
-
public class $Refs extends Object
-
-
Field Summary
Fields Modifier and Type Field Description boolean
circular
URL
file
ExtendedJsonContext
jsonContext
URL
rootDir
-
Constructor Summary
Constructors Constructor Description $Refs(ExtendedJsonContext jsonContext)
$Refs(ExtendedJsonContext jsonContext, URL file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addJsonContext(URL url, ExtendedJsonContext jsonContext)
void
addPath(URL url)
void
addRef(String ref)
Object
get(String $ref)
<T> T
get(String $ref, Class<T> type)
org.apache.commons.lang3.tuple.Pair<com.fasterxml.jackson.core.JsonLocation,com.fasterxml.jackson.core.JsonLocation>
getJsonLocationRange(String jsonPath)
org.apache.commons.lang3.tuple.Pair<com.fasterxml.jackson.core.JsonLocation,com.fasterxml.jackson.core.JsonLocation>
getJsonLocationRange(URL fileURL, String jsonPath)
Object
getObjectForRef($Ref ref)
List<Map<String,Object>>
getOriginalAllOf(Object resolvedAllOf)
$Ref
getOriginalRef(Object obj)
List<org.apache.commons.lang3.tuple.Pair<$Ref,Object>>
getOriginalRefsList()
protected boolean
isOriginalRef(Object value, Object savedValue, Object originalAllOf)
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
saveOriginalAllOf(Map<String,Object> resolvedAllOf, List originalAllOf)
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.
-
-
-
Field Detail
-
circular
public boolean circular
-
jsonContext
public ExtendedJsonContext jsonContext
-
file
public final URL file
-
rootDir
public final URL rootDir
-
-
Constructor Detail
-
$Refs
public $Refs(ExtendedJsonContext jsonContext)
-
$Refs
public $Refs(ExtendedJsonContext jsonContext, URL file)
-
-
Method Detail
-
getOriginalRefsList
public List<org.apache.commons.lang3.tuple.Pair<$Ref,Object>> getOriginalRefsList()
-
isOriginalRef
protected boolean isOriginalRef(Object value, Object savedValue, Object originalAllOf)
-
addRef
public void addRef(String ref)
-
addPath
public void addPath(URL url)
-
addJsonContext
public void addJsonContext(URL url, ExtendedJsonContext jsonContext)
-
saveOriginalAllOf
public void saveOriginalAllOf(Map<String,Object> resolvedAllOf, List originalAllOf)
-
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
-
getJsonLocationRange
public org.apache.commons.lang3.tuple.Pair<com.fasterxml.jackson.core.JsonLocation,com.fasterxml.jackson.core.JsonLocation> getJsonLocationRange(String jsonPath)
-
getJsonLocationRange
public org.apache.commons.lang3.tuple.Pair<com.fasterxml.jackson.core.JsonLocation,com.fasterxml.jackson.core.JsonLocation> getJsonLocationRange(URL fileURL, String jsonPath)
-
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.)
-
-