java.lang.Object
org.eclipse.lemminx.customservice.synapse.schemagen.xsd.JsonSchemaNode
Direct Known Subclasses:
JsonSchemaArrayNode, JsonSchemaElementValueNode, JsonSchemaObjectNode, JsonSchemaOneOfNode

public class JsonSchemaNode extends Object
The JsonSchemaNode class represents a generic JSON Schema node. It provides methods to manage the properties and structure of the node.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected com.fasterxml.jackson.databind.node.ObjectNode
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs 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.
    Constructs a new JsonSchemaNode with the specified ID.
    Constructs a new JsonSchemaNode with the specified ID and type.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the identifier of the JSON Schema node.
    com.fasterxml.jackson.databind.node.ObjectNode
    Returns the JSON object node.
    void
    put(String key, String value)
    Puts a property of the JSON object node with the specified key and string value.
    void
    set(String key, com.fasterxml.jackson.databind.node.ArrayNode value)
    Sets a property of the JSON object node with the specified key and array value.
    void
    set(String key, com.fasterxml.jackson.databind.node.ObjectNode value)
    Sets a property of the JSON object node with the specified key and value.
    void
    Sets the type of the JSON Schema node.
    void
    update(boolean addTitle)
    Updates the JSON Schema node, optionally adding a title.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      protected String 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

      public JsonSchemaNode(String id)
      Constructs a new JsonSchemaNode with the specified ID.
      Parameters:
      id - the identifier for the JSON Schema node
    • JsonSchemaNode

      public JsonSchemaNode(com.fasterxml.jackson.databind.node.ObjectNode node, String id)
      Constructs a new JsonSchemaNode with the specified JSON object node and ID.
      Parameters:
      node - the JSON object node
      id - the identifier for the JSON Schema node
    • JsonSchemaNode

      public JsonSchemaNode(String id, String type)
      Constructs a new JsonSchemaNode with the specified ID and type.
      Parameters:
      id - the identifier for the JSON Schema node
      type - 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 node
      id - the identifier for the JSON Schema node
      type - the type of the JSON Schema node
      name - the name of the JSON Schema node
  • Method Details

    • getId

      public String getId()
      Returns the identifier of the JSON Schema node.
      Returns:
      the identifier of the JSON Schema node
    • setType

      public void setType(String type)
      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

      public void set(String key, com.fasterxml.jackson.databind.node.ObjectNode value)
      Sets a property of the JSON object node with the specified key and value.
      Parameters:
      key - the key of the property
      value - the value of the property
    • set

      public void set(String key, com.fasterxml.jackson.databind.node.ArrayNode value)
      Sets a property of the JSON object node with the specified key and array value.
      Parameters:
      key - the key of the property
      value - the array value of the property
    • put

      public void put(String key, String value)
      Puts a property of the JSON object node with the specified key and string value.
      Parameters:
      key - the key of the property
      value - the string value of the property