Fork me on GitHub

Hierarchy

In package com.mitchellbosecke.pebble.template

public class Hierarchy extends Object

A data structure that represents the entire inheritance hierarchy of the current template and tracks which level in the hierarchy we are currently evaluating.

Constructors

public Hierarchy(PebbleTemplateImpl currentTemplate)

Constructs an inheritance chain with one known template.

Parameters:

Methods

public void pushAncestor(PebbleTemplateImpl ancestor)

Adds a known ancestor onto the inheritance chain, does not increment which template is the "current" template being evaluated.

Parameters:
public void ascend()

Signifies that the parent template in the hierarchy is now being evaluated so it should be considered the "current" template.

Parameters:
  • No parameters
public void descend()

Signifies that the child template in the hierarchy is now being evaluated so i t should be considered the "current" template.

Parameters:
  • No parameters
public PebbleTemplateImpl getChild()

Returns the child of the template currently being evaluated or null if there is no child.

Parameters:
  • No parameters
public PebbleTemplateImpl getParent()

Returns the parent of the template currently being evaluated or null if there is no parent.

Parameters:
  • No parameters