Package dev.harrel.jsonschema
Interface JsonNodeFactory
- All Known Implementing Classes:
GsonNode.Factory
,JacksonNode.Factory
,JakartaJsonNode.Factory
,JettisonNode.Factory
,JsonSmartNode.Factory
,KotlinxJsonNode.Factory
,OrgJsonNode.Factory
,SnakeYamlNode.Factory
public interface JsonNodeFactory
JsonNodeFactory
interface is the main abstraction for provider-agnostic JSON factory.-
Method Summary
-
Method Details
-
wrap
Wraps provider specific JSON node intoJsonNode
. The returned node is considered a root node and all further JSON pointers will be calculated from this node. Main purpose of this method is to avoid additional JSON parsing. It can also be used to convert any instance ofJsonNode
to a root node.- Parameters:
node
- provider specific representation of JSON node- Returns:
- wrapped node
- Throws:
RuntimeException
- when provided node is of invalid type
-
create
CreatesJsonNode
from raw JSON string. The returned node is considered a root node and all further JSON pointers will be calculated from this node.- Parameters:
rawJson
- JSON in string form- Returns:
- created node
- Throws:
RuntimeException
- when creation fails for any reasons (e.g. provided string is not a valid JSON)
-