Class Node

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Node.Cons  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int lineNumber  
      (package private) java.lang.String resourceName  
    • Constructor Summary

      Constructors 
      Constructor Description
      Node​(java.lang.String resourceName, int lineNumber)  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static Node cons​(java.lang.String resourceName, int lineNumber, com.google.common.collect.ImmutableList<Node> nodes)
      Create a new parse tree node that is the concatenation of the given ones.
      (package private) static Node emptyNode​(java.lang.String resourceName, int lineNumber)
      Returns an empty node in the parse tree.
      (package private) abstract java.lang.Object evaluate​(EvaluationContext context)
      Returns the result of evaluating this node in the given context.
      (package private) EvaluationException evaluationException​(java.lang.String message)  
      (package private) EvaluationException evaluationException​(java.lang.Throwable cause)  
      private java.lang.String where()  
      • Methods inherited from class java.lang.Object

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

      • resourceName

        final java.lang.String resourceName
      • lineNumber

        final int lineNumber
    • Constructor Detail

      • Node

        Node​(java.lang.String resourceName,
             int lineNumber)
    • Method Detail

      • evaluate

        abstract java.lang.Object evaluate​(EvaluationContext context)
        Returns the result of evaluating this node in the given context. This result may be used as part of a further operation, for example evaluating 2 + 3 to 5 in order to set $x to 5 in #set ($x = 2 + 3). Or it may be used directly as part of the template output, for example evaluating replacing name by Fred in My name is $name..
      • where

        private java.lang.String where()
      • emptyNode

        static Node emptyNode​(java.lang.String resourceName,
                              int lineNumber)
        Returns an empty node in the parse tree. This is used for example to represent the trivial "else" part of an #if that does not have an explicit #else.
      • cons

        static Node cons​(java.lang.String resourceName,
                         int lineNumber,
                         com.google.common.collect.ImmutableList<Node> nodes)
        Create a new parse tree node that is the concatenation of the given ones. Evaluating the new node produces the same string as evaluating each of the given nodes and concatenating the result.