Package org.thymeleaf.context
Class IdentifierSequences
- java.lang.Object
-
- org.thymeleaf.context.IdentifierSequences
-
public final class IdentifierSequences extends java.lang.ObjectObjects of this class are kept at
ITemplateContextin order to provide templates with a way to create uniqueidattribute values during template processing.- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Integer>idCounts
-
Constructor Summary
Constructors Constructor Description IdentifierSequences()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetAndIncrementIDSeq(java.lang.String id)Returns a new index (ID count) for a specific value of theidattribute, and increments the count.java.lang.IntegergetNextIDSeq(java.lang.String id)Returns the index (ID count) for a specific value of theidattribute without incrementing the count.java.lang.IntegergetPreviousIDSeq(java.lang.String id)Returns the last index (ID count) returned for a specific value of theidattribute (without incrementing the count).
-
-
-
Method Detail
-
getAndIncrementIDSeq
public java.lang.Integer getAndIncrementIDSeq(java.lang.String id)
Returns a new index (ID count) for a specific value of the
idattribute, and increments the count.- Parameters:
id- the ID for which the count will be computed- Returns:
- the new count, ready to be used
-
getNextIDSeq
public java.lang.Integer getNextIDSeq(java.lang.String id)
Returns the index (ID count) for a specific value of the
idattribute without incrementing the count.- Parameters:
id- the ID for which the count will be retrieved- Returns:
- the current count
-
getPreviousIDSeq
public java.lang.Integer getPreviousIDSeq(java.lang.String id)
Returns the last index (ID count) returned for a specific value of the
idattribute (without incrementing the count).- Parameters:
id- the ID for which the last count will be retrieved- Returns:
- the count
-
-