1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.jelly;
18
19 /***
20 * <p><code>DynaTag</code> represents a Jelly custom tag which
21 * can take its attributes dynamically and store them in some data structure.
22 * Typically a DynaTag may use either a Map or a DynaBean to implement itself
23 * which avoids writing explicit getter and setter methods for each possible attribute.
24 * </p>
25 * <p>
26 * This kind of tag can be extremely useful when making HTML-like tags which
27 * generally output all the attributes which are used in the markup, except
28 * one or two special attributes are used, all others pass through.</p>
29 *
30 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
31 * @version $Revision: 155420 $
32 */
33
34 public interface DynaTag extends Tag {
35
36 /*** Sets an attribute value of this tag before the tag is invoked
37 */
38 public void setAttribute(String name, Object value) throws JellyTagException;
39
40 /***
41 * @return the type of the given attribute. By default just return
42 * Object.class if this is not known.
43 * If this method returns Expression.class then the expression will not
44 * be evaluated and just passed in as the attribute value.
45 */
46 public Class getAttributeType(String name) throws JellyTagException;
47 }