Class JsonSchemaNode
java.lang.Object
org.eclipse.lemminx.customservice.synapse.schemagen.xsd.JsonSchemaNode
- Direct Known Subclasses:
JsonSchemaArrayNode,JsonSchemaElementValueNode,JsonSchemaObjectNode,JsonSchemaOneOfNode
The JsonSchemaNode class represents a generic JSON Schema node.
It provides methods to manage the properties and structure of the node.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new JsonSchemaNode with an empty JSON object node.JsonSchemaNode(com.fasterxml.jackson.databind.node.ObjectNode node) Constructs a new JsonSchemaNode with the specified JSON object node.JsonSchemaNode(com.fasterxml.jackson.databind.node.ObjectNode node, String id) Constructs a new JsonSchemaNode with the specified JSON object node and ID.JsonSchemaNode(com.fasterxml.jackson.databind.node.ObjectNode node, String id, String type, String name) Constructs a new JsonSchemaNode with the specified JSON object node, ID, type, and name.JsonSchemaNode(String id) Constructs a new JsonSchemaNode with the specified ID.JsonSchemaNode(String id, String type) Constructs a new JsonSchemaNode with the specified ID and type. -
Method Summary
Modifier and TypeMethodDescriptiongetId()Returns the identifier of the JSON Schema node.com.fasterxml.jackson.databind.node.ObjectNodegetNode()Returns the JSON object node.voidPuts a property of the JSON object node with the specified key and string value.voidSets a property of the JSON object node with the specified key and array value.voidSets a property of the JSON object node with the specified key and value.voidSets the type of the JSON Schema node.voidupdate(boolean addTitle) Updates the JSON Schema node, optionally adding a title.
-
Field Details
-
name
-
node
protected com.fasterxml.jackson.databind.node.ObjectNode node
-
-
Constructor Details
-
JsonSchemaNode
public JsonSchemaNode()Constructs a new JsonSchemaNode with an empty JSON object node. -
JsonSchemaNode
public JsonSchemaNode(com.fasterxml.jackson.databind.node.ObjectNode node) Constructs a new JsonSchemaNode with the specified JSON object node. -
JsonSchemaNode
Constructs a new JsonSchemaNode with the specified ID.- Parameters:
id- the identifier for the JSON Schema node
-
JsonSchemaNode
Constructs a new JsonSchemaNode with the specified JSON object node and ID.- Parameters:
node- the JSON object nodeid- the identifier for the JSON Schema node
-
JsonSchemaNode
Constructs a new JsonSchemaNode with the specified ID and type.- Parameters:
id- the identifier for the JSON Schema nodetype- the type of the JSON Schema node
-
JsonSchemaNode
public JsonSchemaNode(com.fasterxml.jackson.databind.node.ObjectNode node, String id, String type, String name) Constructs a new JsonSchemaNode with the specified JSON object node, ID, type, and name.- Parameters:
node- the JSON object nodeid- the identifier for the JSON Schema nodetype- the type of the JSON Schema nodename- the name of the JSON Schema node
-
-
Method Details
-
getId
Returns the identifier of the JSON Schema node.- Returns:
- the identifier of the JSON Schema node
-
setType
Sets the type of the JSON Schema node.- Parameters:
type- the type to set
-
getNode
public com.fasterxml.jackson.databind.node.ObjectNode getNode()Returns the JSON object node.- Returns:
- the JSON object node
-
update
public void update(boolean addTitle) Updates the JSON Schema node, optionally adding a title.- Parameters:
addTitle- flag indicating whether to add a title
-
set
Sets a property of the JSON object node with the specified key and value.- Parameters:
key- the key of the propertyvalue- the value of the property
-
set
Sets a property of the JSON object node with the specified key and array value.- Parameters:
key- the key of the propertyvalue- the array value of the property
-
put
Puts a property of the JSON object node with the specified key and string value.- Parameters:
key- the key of the propertyvalue- the string value of the property
-