private void printNode(StringBuilder graphText, Node node, List<Node> unvisitedNodes) {
		unvisitedNodes.remove(node);
		// What to generate depends on whether it is a job definition or reference
		if (node.metadata != null && node.metadata.containsKey(Node.METADATAKEY_JOBMODULENAME)) {
			graphText.append(node.metadata.get(Node.METADATAKEY_JOBMODULENAME)).append(" ");
			graphText.append(node.name).append(" ");
			if (node.properties != null) {
				int count = 0;
				for (Map.Entry<String, String> entry : node.properties.entrySet()) {
					if (count > 0) {
						graphText.append(" ");
					}
					graphText.append("--").append(entry.getKey()).append("=").append(entry.getValue());
					count++;
				}
			}
		}
		else {
			String nameInDSL = node.name;
			graphText.append(nameInDSL);
			if (node.properties != null) {
				for (Map.Entry<String, String> entry : node.properties.entrySet()) {
					graphText.append(" ");
					graphText.append("--").append(entry.getKey()).append("=").append(entry.getValue());
				}
			}
		}
	}
Walk a specified link to see if it ever hits the candidate node.

@param link points to the head of a chain of nodes
@param candidate the node possibly found on the chain of nodes
@return true if the candidate is found down the specified chain
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/job/dsl/Graph.java