Package org.apache.velocity.app.tools
Class VelocityFormatter.VelocityAlternator
java.lang.Object
org.apache.velocity.app.tools.VelocityFormatter.VelocityAlternator
- Direct Known Subclasses:
VelocityFormatter.VelocityAutoAlternator
- Enclosing class:
- VelocityFormatter
Class that returns alternating values in a template. It stores
a list of alternate Strings, whenever alternate() is called it
switches to the next in the list. The current alternate is
retrieved through toString() - i.e. just by referencing the
object in a Velocity template. For an example of usage see the
makeAlternator() method below.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVelocityAlternator
(String[] alternates) Constructor takes an array of Strings. -
Method Summary
-
Field Details
-
alternates
-
current
protected int current
-
-
Constructor Details
-
VelocityAlternator
Constructor takes an array of Strings.- Parameters:
alternates
- A String[].
-
-
Method Details