Resolve one node.

@param rawNode the map response from Contentful
@return a CMARichNode from this SDK.
342735
static CMARichNode resolveRichNode(Map<String, Object> rawNode) {
    final String type = (String) rawNode.get("nodeType");
    if (RESOLVER_MAP.containsKey(type)) {
      return RESOLVER_MAP.get(type).resolve(rawNode);
    } else {
      return null;
    }
  }
1024725
public static Node getNode(Model mo, int nodeID) throws JSONConverterException {
        Node n = new Node(nodeID);
        if (!mo.contains(n)) {
            throw new JSONConverterException("Undeclared node '" + nodeID + "'");
        }
        return n;
    }
314262
private String getRootNode() {

        CmsResource resource = null;
        String title = null;
        String folder = getRootFolder();
        try {
            resource = getCms().readFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION);
            // get the title information of the folder
            CmsProperty titleProperty = getCms().readPropertyObject(
                folder,
                CmsPropertyDefinition.PROPERTY_TITLE,
                false);

            if ((titleProperty == null) || titleProperty.isNullProperty()) {
                getCms().getSitePath(resource);
                title = resource.getRootPath();
            } else {
                title = titleProperty.getValue();
            }
            return getNode(resource.getRootPath(), title, resource.getTypeId(), true, resource.getState(), false);
        } catch (CmsException e) {
            // should usually never happen
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
        }
        return "";
    }
1112759
public Node getNode() {
        if (node == null) {
            if (resource != null) {
                node = resource.adaptTo(Node.class);
            }
        }
        return node;
    }
1160940
SimpleNode getNode() {
        if (this.callerInfoNode != null)
            return this.callerInfoNode;
        if (this.parent != null)
            return this.parent.getNode();
        else
            return null;
    }
206908
static boolean nodeAbsent(Object json, Path path, boolean treatNullAsAbsent) {
        Node node = getNode(json, path);
        if (node.isNull()) {
            return treatNullAsAbsent;
        } else {
            return node.isMissingNode();
        }
    }
720284
public Node getNode(String name) {
    Node n = hostnameToNodeMap.get(name);

    // it's ok if multiple threads try to resolve the same host at the same time
    // the assumption is that resolve() will return a canonical node object and
    // the put operation is therefore idempotent
    if (n == null) {
      n = resolveAndGetNode(name);
      hostnameToNodeMap.put(name, n);
      // Make an entry for the node at the max level in the cache
      nodesAtMaxLevel.add(
        getParentNode(n, NetworkTopology.DEFAULT_HOST_LEVEL - 1));
    }

    return n;
  }
528498
public static String getNodeText(Node<?> node, InputBuffer inputBuffer) {
        checkArgNotNull(node, "node");
        checkArgNotNull(inputBuffer, "inputBuffer");
        if (node.hasError()) {
            // if the node has a parse error we cannot simply cut a string out of the underlying input buffer, since we
            // would also include illegal characters, so we need to build it constructively
            StringBuilder sb = new StringBuilder();
            for (int i = node.getStartIndex(); i < node.getEndIndex(); i++) {
                char c = inputBuffer.charAt(i);
                switch (c) {
                    case Chars.DEL_ERROR:
                        i++;
                        break;
                    case Chars.INS_ERROR:
                    case Chars.EOI:
                        break;
                    case Chars.RESYNC_START:
                        i++;
                        while (inputBuffer.charAt(i) != Chars.RESYNC_END) i++;
                        break;
                    case Chars.RESYNC_END:
                    case Chars.RESYNC_EOI:
                    case Chars.RESYNC:
                        // we should only see proper RESYNC_START / RESYNC_END blocks
                        throw new IllegalStateException();
                    default:
                        sb.append(c);
                }
            }
            return sb.toString();
        }        
        return inputBuffer.extract(node.getStartIndex(), node.getEndIndex());
    }
23678
public function resolve(NodeContract $node)
    {
        $children = $node->getChildren();

        if (count($children) > 0) {
            $this->resolve($node->getChildByIndex(0));

            $value = '';
            $positions = [];
            foreach ($node->getChildren() as $child) {
                if ($child instanceof Nodes\TextNode || $child instanceof Nodes\KeyNode) {
                    $value .= ' '.$child->getValue();
                    $p = array_fill(0, strlen(' '.$child->getValue()), $child->getIndex());
                    $positions = array_merge($positions, $p);
                }
            }

            foreach ($this->regex as $regex) {
                preg_match($regex, $value, $match, PREG_OFFSET_CAPTURE);

                if ($match) {
                    $new_node = new $this->node();

                    $start = $match[0][1];
                    $length = strlen($match[0][0]);

                    $this->groupNode($node, $new_node, $start, $start + $length, $positions);
                    $this->resolveRelationsNode($node, $new_node);

                    // Search for another match in this node.
                    return $this->resolve($node->getParent());
                }
            }
        }

        return $node->next() !== null ? $this->resolve($node->next()) : null;
    }
354411
public List<Node> parseWrapper(String raw) {
    // holds literal text as we parse
    StringBuilder buf = new StringBuilder();

    // indicates we're inside a quote.
    boolean inquote = false;

    // indicates we're inside a {x} tag.
    boolean intag = false;

    // length of input pattern
    int length = raw.length();

    // current input pattern index
    int i = 0;

    List<Node> nodes = new ArrayList<>();

    while (i < length) {
      char ch = raw.charAt(i);
      switch (ch) {
        case '{':
          if (buf.length() > 0) {
            nodes.add(new Text(buf.toString()));
            buf.setLength(0);
          }
          intag = true;
          break;

        case '}':
          intag = false;
          break;

        case '\'':
          if (inquote) {
            inquote = false;
          } else {
            inquote = true;
          }
          break;

        default:
          if (intag) {
            nodes.add(new Field(ch, 0));
          } else {
            buf.append(ch);
          }
      }

      i++;
    }

    if (buf.length() > 0) {
      nodes.add(new Text(buf.toString()));
    }
    return nodes;
  }
1153240
@Override
    public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
        if (validating) {
            try {
                InputSource source = null;
                if (publicId != null) {
                    String path = doctypeMap.get(publicId.toUpperCase());
                    source = getInputSource(path);
                }
                if (source == null && systemId != null) {
                    String path = doctypeMap.get(systemId.toUpperCase());
                    source = getInputSource(path);
                }
                return source;
            } catch (Exception e) {
                throw new SAXException(e.toString());
            }
        } else {
            return new InputSource(new StringReader(""));
        }
    }
135957
protected void parse(Node node) {
		NamedNodeMap attributes = node.getAttributes();
		type = getValueRecursive(attributes.getNamedItem("xlink:type"));
		xLink = getValueRecursive(attributes.getNamedItem("xmlns:xlink"));
		href = getValueRecursive(attributes.getNamedItem("xlink:href"));
	}
121530
public List<Node> parse(String raw) {
    // holds literal text as we parse
    StringBuilder buf = new StringBuilder();

    // current field character, \0 if none
    char field = '\0';

    // current field width
    int width = 0;

    // flag indicating we're inside a literal string
    boolean inquote = false;

    // length of input pattern
    int length = raw.length();

    // current input pattern index
    int i = 0;

    List<Node> nodes = new ArrayList<>();

    while (i < length) {
      char ch = raw.charAt(i);

      // Handle appending / terminating the single-quote delimited sequence.
      if (inquote) {
        if (ch == '\'') {
          inquote = false;
          field = '\0';
        } else {
          buf.append(ch);
        }
        i++;
        continue;
      }

      switch (ch) {

        // Date pattern field characters.
        case 'G':
        case 'y':
        case 'Y':
        case 'u':
        case 'U':
        case 'r':
        case 'Q':
        case 'q':
        case 'M':
        case 'L':
        case 'l':
        case 'w':
        case 'W':
        case 'd':
        case 'D':
        case 'F':
        case 'g':
        case 'E':
        case 'e':
        case 'c':
        case 'a':
        case 'b':
        case 'B':
        case 'h':
        case 'H':
        case 'K':
        case 'k':
        case 'j':
        case 'J':
        case 'C':
        case 'm':
        case 's':
        case 'S':
        case 'A':
        case 'z':
        case 'Z':
        case 'O':
        case 'v':
        case 'V':
        case 'X':
        case 'x':
          // Before we start this field, check if we have text to push.
          if (buf.length() > 0) {
            nodes.add(new Text(buf.toString()));
            buf.setLength(0);
          }

          // A change in character indicates we're starting a new field;
          // otherwise we're widening an existing field.
          if (ch != field) {

            // If we have a field defined, add it.
            if (field != '\0') {
              nodes.add(new Field(field, width));
            }

            // Start a new field.
            field = ch;
            width = 1;

          } else {
            // Widen the current field.
            width++;
          }

          // Indicate we've started a new field.
          break;

        default:
          // If we have a current field, add it.
          if (field != '\0') {
            nodes.add(new Field(field, width));
          }

          // Clear the field.
          field = '\0';

          // Single quotes escape literal characters used for field patterns.
          if (ch == '\'') {
            inquote = true;
          } else {
            // Append a character
            buf.append(ch);
          }
          break;
      }
      i++;

    }

    if (width > 0 && field != '\0') {
      nodes.add(new Field(field, width));
    } else if (buf.length() > 0) {
      nodes.add(new Text(buf.toString()));
    }

    return nodes;
  }
926840
public KdTree.Node requestNode() {
		if( unusedNodes.isEmpty() )
			return new KdTree.Node();
		return unusedNodes.remove( unusedNodes.size()-1);
	}
1014022
public Node<T> node(T content) {
    final Node<T> search = nodes.get(content);
    if (search != null)
      return search;
    final Node<T> n = new Node<>(content, this);
    nodes.put(content, n);
    return n;
  }
295747
@Override
    public String resolve(MessageResolver messageResolver) {
        MessageResolver.assertThatIsNotNull(messageResolver);

        return messageResolver.resolve(this.code, this.arguments);
    }
1092501
private CompletableFuture<NodeMultiZipper<ExecutionResultNode>> resolveNodes(ExecutionContext executionContext, List<NodeMultiZipper<ExecutionResultNode>> unresolvedNodes) {
        assertNotEmpty(unresolvedNodes, "unresolvedNodes can't be empty");
        ExecutionResultNode commonRoot = unresolvedNodes.get(0).getCommonRoot();
        CompletableFuture<List<List<NodeZipper<ExecutionResultNode>>>> listListCF = Async.flatMap(unresolvedNodes,
                executionResultMultiZipper -> fetchAndAnalyze(executionContext, executionResultMultiZipper.getZippers()));

        return flatList(listListCF).thenApply(zippers -> new NodeMultiZipper<ExecutionResultNode>(commonRoot, zippers, RESULT_NODE_ADAPTER));
    }