|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.tools.generic.AlternatorTool
Simple tool to provide easy in-template instantiation of
Alternator
s from varying "list" types.
Example Use:
toolbox.xml... <tool> <key>alternator</key> <scope>application</scope> <class>org.apache.velocity.tools.generic.AlternatorTool</class> </tool> template... #set( $color = $alternator.make('red', 'blue') ) ## use manual alternation for this one #set( $style = $alternator.make(false, ['hip','fly','groovy']) ) #foreach( $i in [1..5] ) $i is $color and $style.next #end output... 1 is red and hip 2 is blue and fly 3 is red and groovy 4 is blue and hip 5 is red and fly
Constructor Summary | |
AlternatorTool()
|
Method Summary | |
Alternator |
make(boolean auto,
java.util.List list)
Make an Alternator from a List. |
Alternator |
make(boolean auto,
java.lang.Object[] array)
Make an Alternator from an object array. |
Alternator |
make(boolean auto,
java.lang.Object o1,
java.lang.Object o2)
Make an Alternator from a list containing the two
specified objects. |
Alternator |
make(java.util.List list)
Make an automatic Alternator from a List. |
Alternator |
make(java.lang.Object[] array)
Make an automatic Alternator from an object array. |
Alternator |
make(java.lang.Object o1,
java.lang.Object o2)
Make an automatic Alternator from a list containing the two
specified objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AlternatorTool()
Method Detail |
public Alternator make(java.util.List list)
Alternator
from a List.
public Alternator make(boolean auto, java.util.List list)
Alternator
from a List.
null
if arguments
were illegal.public Alternator make(java.lang.Object[] array)
Alternator
from an object array.
public Alternator make(boolean auto, java.lang.Object[] array)
Alternator
from an object array.
null
if arguments
were illegal.public Alternator make(java.lang.Object o1, java.lang.Object o2)
Alternator
from a list containing the two
specified objects.
null
if arguments
were illegal.public Alternator make(boolean auto, java.lang.Object o1, java.lang.Object o2)
Alternator
from a list containing the two
specified objects.
o1
- The first of two objects for alternation between.
Must be non-null
.o2
- The second of two objects for alternation between.
Must be non-null
.
null
if arguments
were illegal.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |