Class JsonSchemaObjectNode

java.lang.Object
org.eclipse.lemminx.customservice.synapse.schemagen.xsd.JsonSchemaNode
org.eclipse.lemminx.customservice.synapse.schemagen.xsd.JsonSchemaObjectNode

public class JsonSchemaObjectNode extends JsonSchemaNode
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.
  • Constructor Details

    • JsonSchemaObjectNode

      public JsonSchemaObjectNode(String id)
      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 node
      id - the identifier for the JSON Schema node
      name - 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:
      update in class JsonSchemaNode
      Parameters:
      addTitle - flag indicating whether to add a title
    • addProperty

      public void addProperty(String name, com.fasterxml.jackson.databind.node.ObjectNode property)
      Adds a property to this JSON Schema object node.
      Parameters:
      name - the name of the property
      property - the JSON Schema node representing the property
    • addRequiredElement

      public void addRequiredElement(String itemName)
      Adds a required element to this JSON Schema object node.
      Parameters:
      itemName - the name of the required element