Class JsonSchemaObjectNode
java.lang.Object
org.eclipse.lemminx.customservice.synapse.schemagen.xsd.JsonSchemaNode
org.eclipse.lemminx.customservice.synapse.schemagen.xsd.JsonSchemaObjectNode
The JsonSchemaObjectNode class represents a JSON Schema node for object types.
It extends the JsonSchemaNode class and provides methods to manage object properties and required elements.
-
Field Summary
Fields inherited from class org.eclipse.lemminx.customservice.synapse.schemagen.xsd.JsonSchemaNode
name, node -
Constructor Summary
ConstructorsConstructorDescriptionJsonSchemaObjectNode(com.fasterxml.jackson.databind.node.ObjectNode node, String id, String name) Constructs a new JsonSchemaObjectNode with the specified JSON object node, ID, and name.Constructs a new JsonSchemaObjectNode with the specified ID. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(String name, com.fasterxml.jackson.databind.node.ObjectNode property) Adds a property to this JSON Schema object node.voidaddRequiredElement(String itemName) Adds a required element to this JSON Schema object node.voidupdate(boolean addTitle) Updates the JSON Schema object node, optionally adding a title.
-
Constructor Details
-
JsonSchemaObjectNode
Constructs a new JsonSchemaObjectNode with the specified ID.- Parameters:
id- the identifier for the JSON Schema node
-
JsonSchemaObjectNode
public JsonSchemaObjectNode(com.fasterxml.jackson.databind.node.ObjectNode node, String id, String name) Constructs a new JsonSchemaObjectNode with the specified JSON object node, ID, and name.- Parameters:
node- the JSON object nodeid- the identifier for the JSON Schema nodename- the name of the JSON Schema node
-
-
Method Details
-
update
public void update(boolean addTitle) Updates the JSON Schema object node, optionally adding a title.- Overrides:
updatein classJsonSchemaNode- Parameters:
addTitle- flag indicating whether to add a title
-
addProperty
Adds a property to this JSON Schema object node.- Parameters:
name- the name of the propertyproperty- the JSON Schema node representing the property
-
addRequiredElement
Adds a required element to this JSON Schema object node.- Parameters:
itemName- the name of the required element
-