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 booleancircularURIfileExtendedJsonContextjsonContextURIrootDir
-
Constructor Summary
Constructors Constructor Description $Refs(ExtendedJsonContext jsonContext)$Refs(ExtendedJsonContext jsonContext, URI file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddJsonContext(URI url, ExtendedJsonContext jsonContext)voidaddPath(URI uri)voidaddPath(URL url)voidaddRef(String ref)Objectget(String $ref)<T> Tget(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(URI fileURI, String jsonPath)ObjectgetObjectForRef($Ref ref)List<Map<String,Object>>getOriginalAllOf(Object resolvedAllOf)$RefgetOriginalRef(Object obj)List<org.apache.commons.lang3.tuple.Pair<$Ref,Object>>getOriginalRefsList()protected booleanisOriginalRef(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)voidsaveOriginalAllOf(Map<String,Object> resolvedAllOf, List originalAllOf)voidsaveOriginalRef($Ref originalRef, Object resolved)Map<String,Object>schema()voidset(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 URI file
-
rootDir
public final URI rootDir
-
-
Constructor Detail
-
$Refs
public $Refs(ExtendedJsonContext jsonContext)
-
$Refs
public $Refs(ExtendedJsonContext jsonContext, URI 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)
-
addPath
public void addPath(URI uri)
-
addJsonContext
public void addJsonContext(URI 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(URI fileURI, 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.)
-
-