1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.jelly.tags.define;
17
18 import org.apache.commons.jelly.JellyTagException;
19 import org.apache.commons.jelly.TagSupport;
20 import org.apache.commons.jelly.XMLOutput;
21
22 /***
23 * <super> tag is used to invoke a parent tag implementation, when
24 * a tag extends an existing tag
25 *
26 * @author <a href="mailto:tima@intalio.com">Tim Anderson</a>
27 * @version $Revision: 155420 $
28 * @see ExtendTag
29 */
30 public class SuperTag extends TagSupport {
31
32 public SuperTag() {
33 }
34
35
36
37 public void doTag(XMLOutput output) throws JellyTagException {
38 ExtendTag tag = (ExtendTag) findAncestorWithClass(ExtendTag.class);
39 if (tag == null) {
40 throw new JellyTagException(
41 "<define:super> must be inside a <define:extend>");
42 }
43
44 tag.getSuperScript().run(getContext(), output);
45 }
46 }
47