Class ReferencedNodeImporter

    • Constructor Detail

      • ReferencedNodeImporter

        public ReferencedNodeImporter​(Document doc,
                                      Node nodeWithUnresolvedRef,
                                      String ref,
                                      boolean shouldInline)
    • Method Detail

      • getImportedNode

        public Node getImportedNode()
      • getPathToImportedNode

        public String getPathToImportedNode()
      • getNodeWithUnresolvedRef

        protected Node getNodeWithUnresolvedRef()
      • getRef

        protected String getRef()
      • shouldInline

        public boolean shouldInline()
      • getNameHintFromRef

        public String getNameHintFromRef​(String defaultHint)
      • importNode

        public void importNode​(Node resolvedNode)
      • importJson

        public void importJson​(com.fasterxml.jackson.databind.JsonNode jsonNode,
                               String mediaType)
        Imports a JsonNode (JSON/YAML content that is not OpenAPI/AsyncAPI). Subclasses should override this method to handle JSON content appropriately. The default implementation throws an UnsupportedOperationException.
        Parameters:
        jsonNode - the JsonNode to import
        mediaType - the media type of the content (may be null)
      • importText

        public void importText​(String textContent,
                               String mediaType)
        Imports text content (non-JSON content such as Protocol Buffers, GraphQL, etc.). Subclasses should override this method to handle text content appropriately. The default implementation throws an UnsupportedOperationException.
        Parameters:
        textContent - the text content to import
        mediaType - the media type of the content (may be null)
      • setPathToImportedNode

        public void setPathToImportedNode​(Node importedNode,
                                          String pathToImportedNode)
      • getComponentName

        protected String getComponentName​(Node nodeWithUnresolvedRef)
      • inlineComponent

        protected void inlineComponent​(String componentType,
                                       Node node)
      • setPathToImportedNode

        protected abstract void setPathToImportedNode​(Node nodeWithUnresolvedRef,
                                                      String componentType,
                                                      String componentName)