KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > jelly > DynaTag


1 /*
2  * Copyright 2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
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 JavaDoc name, Object JavaDoc 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 JavaDoc getAttributeType(String JavaDoc name) throws JellyTagException;
47 }
48
Popular Tags