Java Doc for AlternatorTool.java in  » Template-Engine » Velocity » org » apache » velocity » tools » generic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Template Engine » Velocity » org.apache.velocity.tools.generic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.velocity.tools.generic.AlternatorTool

AlternatorTool
public class AlternatorTool (Code)
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>
 <parameter name="auto-alternate" value="true"/>
 </tool>
 template...
 #set( $color = $alternator.auto('red', 'blue') )
 ## use manual alternation for this one
 #set( $style = $alternator.manual(['hip','fly','groovy']) )
 #foreach( $i in [1..5] )
 Number $i is $color and $style. I dig $style.next numbers.
 #end *
 output...
 Number 1 is red and hip. I dig hip numbers.
 Number 2 is blue and fly. I dig fly numbers.
 Number 3 is red and groovy. I dig groovy numbers.
 Number 4 is blue and hip. I dig hip numbers.
 Number 5 is red and fly. I dig fly numbers.
 


since:
   Velocity Tools 1.2
version:
   $Revision: 484710 $ $Date: 2006-12-08 11:40:42 -0800 (Fri, 08 Dec 2006) $


Field Summary
final public static  StringAUTO_ALTERNATE_DEFAULT_KEY
    


Method Summary
public  Alternatorauto(List list)
     Make an automatic Alternator from values in the specified List.
public  Alternatorauto(Object[] array)
     Make an automatic Alternator from the specified object array.
public  Alternatorauto(Object o1, Object o2)
     Make an automatic Alternator from a list containing the two specified objects.
Parameters:
  o1 - The first of two objects for alternation between.Must be non-null.
Parameters:
  o2 - The second of two objects for alternation between.Must be non-null.
public  voidconfigure(Map params)
     Looks for a default auto-alternate value in the given params, if not, set the default to true.
public  booleangetAutoAlternateDefault()
     Returns true if the default for auto-alternating is true.
public  Alternatormake(List list)
     Make an automatic Alternator from a List.
public  Alternatormake(boolean auto, List list)
    
public  Alternatormake(Object[] array)
     Make an automatic Alternator from an object array.
public  Alternatormake(boolean auto, Object[] array)
    
public  Alternatormake(Object o1, Object o2)
     Make an automatic Alternator from a list containing the two specified objects.
public  Alternatormake(boolean auto, Object o1, Object o2)
    
public  Alternatormanual(List list)
     Make a manual Alternator from values in the specified List.
public  Alternatormanual(Object[] array)
     Make a manual Alternator from the specified object array.
public  Alternatormanual(Object o1, Object o2)
     Make a manual Alternator from a list containing the two specified objects.
Parameters:
  o1 - The first of two objects for alternation between.Must be non-null.
Parameters:
  o2 - The second of two objects for alternation between.Must be non-null.
protected  voidsetAutoAlternateDefault(boolean bool)
     Sets the default for auto-alternating.

Field Detail
AUTO_ALTERNATE_DEFAULT_KEY
final public static String AUTO_ALTERNATE_DEFAULT_KEY(Code)

since:
   VelocityTools 1.3





Method Detail
auto
public Alternator auto(List list)(Code)
Make an automatic Alternator from values in the specified List. a new, automatic Alternator with the values in the List or null if the List is null.
since:
   VelocityTools 1.3



auto
public Alternator auto(Object[] array)(Code)
Make an automatic Alternator from the specified object array. a new, automatic Alternator with the values in the array or null if the array is null.
since:
   VelocityTools 1.3



auto
public Alternator auto(Object o1, Object o2)(Code)
Make an automatic Alternator from a list containing the two specified objects.
Parameters:
  o1 - The first of two objects for alternation between.Must be non-null.
Parameters:
  o2 - The second of two objects for alternation between.Must be non-null. The new Alternator, or null if an argumentwas null.
since:
   VelocityTools 1.3



configure
public void configure(Map params)(Code)
Looks for a default auto-alternate value in the given params, if not, set the default to true.
since:
   VelocityTools 1.3



getAutoAlternateDefault
public boolean getAutoAlternateDefault()(Code)
Returns true if the default for auto-alternating is true.
since:
   VelocityTools 1.3



make
public Alternator make(List list)(Code)
Make an automatic Alternator from a List.



make
public Alternator make(boolean auto, List list)(Code)
AlternatorTool.auto(List list)AlternatorTool.manual(List list)



make
public Alternator make(Object[] array)(Code)
Make an automatic Alternator from an object array.



make
public Alternator make(boolean auto, Object[] array)(Code)
AlternatorTool.auto(Object[] array)AlternatorTool.manual(Object[] array)



make
public Alternator make(Object o1, Object o2)(Code)
Make an automatic Alternator from a list containing the two specified objects. The new Alternator, or null if argumentswere illegal.



make
public Alternator make(boolean auto, Object o1, Object o2)(Code)
AlternatorTool.auto(Object o1,Object o2)AlternatorTool.manual(Object o1,Object o2)



manual
public Alternator manual(List list)(Code)
Make a manual Alternator from values in the specified List. a new, manual Alternator with the values in the List or null if the List is null.
since:
   VelocityTools 1.3



manual
public Alternator manual(Object[] array)(Code)
Make a manual Alternator from the specified object array. a new, manual Alternator with the values in the array or null if the array is null.
since:
   VelocityTools 1.3



manual
public Alternator manual(Object o1, Object o2)(Code)
Make a manual Alternator from a list containing the two specified objects.
Parameters:
  o1 - The first of two objects for alternation between.Must be non-null.
Parameters:
  o2 - The second of two objects for alternation between.Must be non-null. The new Alternator, or null if an argumentwas null.
since:
   VelocityTools 1.3



setAutoAlternateDefault
protected void setAutoAlternateDefault(boolean bool)(Code)
Sets the default for auto-alternating.
since:
   VelocityTools 1.3



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.