Top Description Fields Constructors Methods
org.hibernate.validator.internal.engine.messageinterpolation.parser

public Class TokenIterator

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List

Allows to iterate over a list of message tokens and replace parameters.
Author
Hardy Ferentschik

Field Summary

Modifier and TypeField and Description
private boolean
private int
private Token
private boolean
private final List<Token>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public boolean

Returns:

Returns true in case there are more message parameters, false otherwise.
hasMoreInterpolationTerms
()

Called to advance the next interpolation term of the message descriptor.

public String

Returns:

Returns the next interpolation term
nextInterpolationTerm
()

public void
replaceCurrentInterpolationTerm(String
The string to replace the current term with.
replacement
)

Replaces the current interpolation term with the given string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allInterpolationTermsProcessedback to summary
private boolean allInterpolationTermsProcessed
currentPositionback to summary
private int currentPosition
currentTokenback to summary
private Token currentToken
currentTokenAvailableback to summary
private boolean currentTokenAvailable
tokenListback to summary
private final List<Token> tokenList

Constructor Detail

TokenIteratorback to summary
public TokenIterator(List<Token> tokens)

Method Detail

getInterpolatedMessageback to summary
public String getInterpolatedMessage()
hasMoreInterpolationTermsback to summary
public boolean hasMoreInterpolationTerms() throws MessageDescriptorFormatException

Called to advance the next interpolation term of the message descriptor. This message can be called multiple times. Once it returns false all interpolation terms have been processed and getInterpolatedMessage() can be called.

Returns:boolean

Returns true in case there are more message parameters, false otherwise.

Exceptions
MessageDescriptorFormatException:
in case the message descriptor is invalid
nextInterpolationTermback to summary
public String nextInterpolationTerm()
Returns:String

Returns the next interpolation term

replaceCurrentInterpolationTermback to summary
public void replaceCurrentInterpolationTerm(String replacement)

Replaces the current interpolation term with the given string.

Parameters
replacement:String

The string to replace the current term with.