Class NodeToStringTransformer


  • public class NodeToStringTransformer
    extends java.lang.Object
    Compiles a previously parsed Node chain into a String.
    • Method Detail

      • compileNode

        private void compileNode​(Node inputNode,
                                 java.lang.StringBuilder stringBuilder,
                                 java.util.Stack<Node> cycleCheckStack)
                          throws ScanException
        Throws:
        ScanException
      • handleVariable

        private void handleVariable​(Node n,
                                    java.lang.StringBuilder stringBuilder,
                                    java.util.Stack<Node> cycleCheckStack)
                             throws ScanException
        Throws:
        ScanException
      • lookupKey

        private java.lang.String lookupKey​(java.lang.String key)
      • handleLiteral

        private void handleLiteral​(Node n,
                                   java.lang.StringBuilder stringBuilder)
      • variableNodeValue

        private java.lang.String variableNodeValue​(Node variableNode)
      • constructRecursionErrorMessage

        private java.lang.String constructRecursionErrorMessage​(java.util.Stack<Node> recursionNodes)
      • haveVisitedNodeAlready

        private boolean haveVisitedNodeAlready​(Node node,
                                               java.util.Stack<Node> cycleDetectionStack)
        Determine if a node has already been visited already by checking the cycleDetectionStack for it's existence. This method is used -- rather than Stack.contains() -- because we want to ignore the Node's 'next' attribute when comparing for equality.
      • equalNodes

        private boolean equalNodes​(Node node1,
                                   Node node2)