Class BlockContextStack
- java.lang.Object
- 
- java.util.AbstractCollection<E>
- 
- java.util.AbstractList<E>
- 
- java.util.AbstractSequentialList<E>
- 
- java.util.LinkedList<BlockContext<?>>
- 
- org.keycloak.models.map.storage.file.common.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 BlockContextinstance which represents the root context of the YAML tree. Every sequence item and mapping value in the YAML file leads to pushing a newBlockContextonto the stack which is created by the topmostBlockContext.getContext(java.lang.String)method of the topmostBlockContext. This context is removed from the stack once parsing of the respective sequence item or mapping pair is finished.- Author:
- hmlnarik
- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class java.util.AbstractListmodCount
 
- 
 - 
Constructor SummaryConstructors Constructor Description BlockContextStack(BlockContext<?> rootElement)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockContext<?>push(String name, Supplier<BlockContext<?>> nullProducer)Pushes the subcontext to the stack.- 
Methods inherited from class java.util.LinkedListadd, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
 - 
Methods inherited from class java.util.AbstractSequentialListiterator
 - 
Methods inherited from class java.util.AbstractListequals, hashCode, listIterator, removeRange, subList
 - 
Methods inherited from class java.util.AbstractCollectioncontainsAll, isEmpty, removeAll, retainAll, toString
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArray
 - 
Methods inherited from interface java.util.ListcontainsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
 
- 
 
- 
- 
- 
Constructor Detail- 
BlockContextStackpublic BlockContextStack(BlockContext<?> rootElement) 
 
- 
 - 
Method Detail- 
pushpublic BlockContext<?> push(String name, Supplier<BlockContext<?>> nullProducer) Pushes the subcontext to the stack.The subcontext is created by calling BlockContext.getContext(java.lang.String)method. If this method returnsnull, the control reverts to producing the subcontext usingnullProducerwhich must return a validBlockContextobject (it must not return {@code null).- Parameters:
- name-
- nullProducer-
- Returns:
 
 
- 
 
-