1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts2.views;
23
24 import java.util.List;
25
26 import javax.servlet.http.HttpServletRequest;
27 import javax.servlet.http.HttpServletResponse;
28
29 import com.opensymphony.xwork2.util.ValueStack;
30
31 /***
32 * Provides Velocity and Freemarker implementation classes for a tag library
33 */
34 public interface TagLibrary {
35
36 /***
37 * Gets a Java object that contains getters for the tag library's Freemarker models.
38 * Called once per Freemarker template processing.
39 *
40 * @param stack The current value stack
41 * @param req The HTTP request
42 * @param res The HTTP response
43 * @return The Java object containing the Freemarker model getter methods
44 */
45 public Object getFreemarkerModels(ValueStack stack, HttpServletRequest req, HttpServletResponse res);
46
47 /***
48 * Gets a list of Velocity directive classes for the tag library. Called once on framework
49 * startup when initializing Velocity.
50 *
51 * @return A list of Velocity directive classes
52 */
53 public List<Class> getVelocityDirectiveClasses();
54 }