Package org.springframework.beans.factory.parsing

# Class ParseState

java.lang.Object
org.springframework.beans.factory.parsing.ParseState

public final class ParseState extends Object
Simple `ArrayDeque`-based structure for tracking the logical position during a parsing process. `entries` are added to the ArrayDeque at each point during the parse phase in a reader-specific manner.

Calling `toString()` will render a tree-style view of the current logical position in the parse phase. This representation is intended for use in error messages.

Since:
  2.0
Author:
  Rob Harrop, Juergen Hoeller

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`ParseState.Entry`
Marker interface for entries into the `ParseState`.

## Constructor Summary

Constructors
Constructor
Description
`ParseState()`
Create a new `ParseState` with an empty `ArrayDeque`.

## Method Summary

Modifier and Type
Method
Description
`ParseState.Entry`
`peek()`
Return the `ParseState.Entry` currently at the top of the `ArrayDeque` or `null` if the `ArrayDeque` is empty.
`void`
`pop()`
Remove an `ParseState.Entry` from the `ArrayDeque`.
`void`
`push(ParseState.Entry entry)`
Add a new `ParseState.Entry` to the `ArrayDeque`.
`ParseState`
`snapshot()`
Create a new instance of `ParseState` which is an independent snapshot of this instance.
`String`
`toString()`
Returns a tree-style representation of the current `ParseState`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ParseState

public ParseState()
Create a new `ParseState` with an empty `ArrayDeque`.

## Method Details

### push

public void push(ParseState.Entry entry)
Add a new `ParseState.Entry` to the `ArrayDeque`.

### pop

public void pop()
Remove an `ParseState.Entry` from the `ArrayDeque`.

### peek

@Nullable public ParseState.Entry peek()
Return the `ParseState.Entry` currently at the top of the `ArrayDeque` or `null` if the `ArrayDeque` is empty.

### snapshot

public ParseState snapshot()
Create a new instance of `ParseState` which is an independent snapshot of this instance.

### toString

public String toString()
Returns a tree-style representation of the current `ParseState`.

Overrides:
  `toString` in class `Object`