Top Description Inners Fields Constructors Methods
com.google.escapevelocity

pack-priv abstract Class Node

extends Object
Class Inheritance
Known Direct Subclasses
com.google.escapevelocity.Node.Cons, com.google.escapevelocity.ParseNode, com.google.escapevelocity.Parser.CommentNode, com.google.escapevelocity.Parser.EvaluateNode, com.google.escapevelocity.StopNode, com.google.escapevelocity.DirectiveNode, com.google.escapevelocity.ExpressionNode
Imports
com.google.common.collect.ImmutableList

A node in the parse tree.
Author
[email protected] (Éamonn McManus)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final String

Constructor Summary

AccessConstructor and Description
pack-priv
Node(String resourceName, int lineNumber)

Method Summary

Modifier and TypeMethod and Description
pack-priv static Node
cons(String resourceName, int lineNumber, ImmutableList<Node> nodes)

Create a new parse tree node that is the concatenation of the given ones.

pack-priv static Node
emptyNode(String resourceName, int lineNumber)

Returns an empty node in the parse tree.

pack-priv EvaluationException
pack-priv EvaluationException
pack-priv boolean
isHorizontalWhitespace()

True if this node is just a span of horizontal whitespace in the text.

pack-priv abstract void
render(EvaluationContext context, StringBuilder output)

Adds this node's contribution to the output.

private String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lineNumberback to summary
pack-priv final int lineNumber
resourceNameback to summary
pack-priv final String resourceName

Constructor Detail

Nodeback to summary
pack-priv Node(String resourceName, int lineNumber)

Method Detail

consback to summary
pack-priv static Node cons(String resourceName, int lineNumber, 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.

emptyNodeback to summary
pack-priv static Node emptyNode(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.

evaluationExceptionback to summary
pack-priv EvaluationException evaluationException(String message)
evaluationExceptionback to summary
pack-priv EvaluationException evaluationException(Throwable cause)
isHorizontalWhitespaceback to summary
pack-priv boolean isHorizontalWhitespace()

True if this node is just a span of horizontal whitespace in the text.

renderback to summary
pack-priv abstract void render(EvaluationContext context, StringBuilder output)

Adds this node's contribution to the output. Depending on the node type, this might be plain text from the template, or one branch of an #if, or the value of a $reference, etc.

whereback to summary
private String where()
com.google.escapevelocity back to summary

private final Class Node.Cons

extends Node
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ImmutableList<Node>
Inherited from com.google.escapevelocity.Node:
lineNumberresourceName

Constructor Summary

AccessConstructor and Description
pack-priv
Cons(String resourceName, int lineNumber, ImmutableList<Node> nodes)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
render(EvaluationContext context, StringBuilder output)

Implements abstract com.google.escapevelocity.Node.render.

Adds this node's contribution to the output.
Inherited from com.google.escapevelocity.Node:
consemptyNodeevaluationExceptionevaluationExceptionisHorizontalWhitespace

Field Detail

nodesback to summary
private final ImmutableList<Node> nodes

Constructor Detail

Consback to summary
pack-priv Cons(String resourceName, int lineNumber, ImmutableList<Node> nodes)

Method Detail

renderback to summary
pack-priv void render(EvaluationContext context, StringBuilder output)

Implements abstract com.google.escapevelocity.Node.render.

Doc from com.google.escapevelocity.Node.render.

Adds this node's contribution to the output. Depending on the node type, this might be plain text from the template, or one branch of an #if, or the value of a $reference, etc.

Annotations
@Override