Class BlockContextStack

All Implemented Interfaces:
Serializable, Cloneable, Iterable<BlockContext<?>>, Collection<BlockContext<?>>, Deque<BlockContext<?>>, List<BlockContext<?>>, Queue<BlockContext<?>>

public class BlockContextStack extends LinkedList<BlockContext<?>>
A special stack suited for tracking the parser of a block language, and maintaining contextual information for block nesting position in the YAML file.

The intention is as follows: Initially, it contains a single BlockContext instance which represents the root context of the YAML tree. Every sequence item and mapping value in the YAML file leads to pushing a new BlockContext onto the stack which is created by the topmost BlockContext.getContext(java.lang.String) method of the topmost BlockContext. This context is removed from the stack once parsing of the respective sequence item or mapping pair is finished.

Author:
hmlnarik
See Also:
  • Constructor Details

    • BlockContextStack

      public BlockContextStack(BlockContext<?> rootElement)
  • Method Details