Line | Hits | Source |
---|---|---|
1 | /* | |
2 | Chrysalis Web Framework [http://chrysalis.sourceforge.net] | |
3 | Copyright (c) 2002, 2003, 2004, Paul Strack | |
4 | ||
5 | All rights reserved. | |
6 | ||
7 | Redistribution and use in source and binary forms, with or without | |
8 | modification, are permitted provided that the following conditions are met: | |
9 | ||
10 | 1. Redistributions of source code must retain the above copyright notice, this | |
11 | list of conditions and the following disclaimer. | |
12 | ||
13 | 2. Redistributions in binary form must reproduce the above copyright notice, | |
14 | this list of conditions and the following disclaimer in the documentation | |
15 | and/or other materials provided with the distribution. | |
16 | ||
17 | 3. Neither the name of the copyright holder nor the names of its contributors | |
18 | may be used to endorse or promote products derived from this software without | |
19 | specific prior written permission. | |
20 | ||
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | |
25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | |
28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | |
32 | ||
33 | package org.chwf.taglib.jutil; | |
34 | ||
35 | import javax.servlet.jsp.JspException; | |
36 | ||
37 | import org.chwf.taglib.base.Parameterized; | |
38 | ||
39 | /** | |
40 | * Tag handler for the <code><attribute></code> tag. It is equivalent | |
41 | * to the <code><param></code> tag, except that it updates the nearest | |
42 | * matching <code><element></code> tag rather than the parent tag. | |
43 | * Despite its name, this tag adds data to its parent tag via its | |
44 | * <code>addParameter()</code> method. | |
45 | * | |
46 | * @author <a href="mailto:pfstrack@users.sourceforge.net">Paul Strack</a> | |
47 | */ | |
48 | 16 | public class AttributeTag extends ParamTag { |
49 | ||
50 | /** | |
51 | * The parameter name. | |
52 | * | |
53 | * @param name The parameter name. | |
54 | */ | |
55 | public void setName(String name) { | |
56 | 8 | super.setName(name); |
57 | 8 | } |
58 | ||
59 | /** | |
60 | * The object property being retrieved. Defaults to var if absent. | |
61 | * | |
62 | * @param property The property name. | |
63 | * @throws JspException If the property cannot be initialized. | |
64 | */ | |
65 | public void setProperty(String property) throws JspException { | |
66 | 3 | super.setProperty(property); |
67 | 3 | } |
68 | ||
69 | /** | |
70 | * The object name. Always optional. The tag will use the default object if | |
71 | * no object can is specified. | |
72 | * | |
73 | * @param objectName The object's name for lookup. | |
74 | * @throws JspException If the object filter cannot be found. | |
75 | */ | |
76 | public void setObject(String objectName) throws JspException { | |
77 | 4 | super.setObject(objectName); |
78 | 4 | } |
79 | ||
80 | /** | |
81 | * Derived parametrized tag to be updated. | |
82 | * | |
83 | * @return The parametrized tag. | |
84 | */ | |
85 | protected Parameterized getParametrizedTag() { | |
86 | 6 | return (Parameterized) findAncestorWithClass(this, ElementTag.class); |
87 | } | |
88 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |