KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > tag > rt > core > ForEachTag


1 /*
2  * Copyright 1999-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.taglibs.standard.tag.rt.core;
18
19 import java.util.ArrayList JavaDoc;
20
21 import javax.servlet.jsp.JspTagException JavaDoc;
22 import javax.servlet.jsp.jstl.core.LoopTag;
23 import javax.servlet.jsp.tagext.IterationTag JavaDoc;
24
25 import org.apache.taglibs.standard.tag.common.core.ForEachSupport;
26
27 /**
28  * <p>A handler for &lt;forEach&gt; that supports rtexprvalue-based
29  * attributes.</p>
30  *
31  * @author Shawn Bayern
32  */

33
34 public class ForEachTag
35     extends ForEachSupport
36     implements LoopTag, IterationTag JavaDoc
37 {
38
39     //*********************************************************************
40
// Accessor methods
41

42     // for tag attribute
43
public void setBegin(int begin) throws JspTagException JavaDoc {
44         this.beginSpecified = true;
45         this.begin = begin;
46         validateBegin();
47     }
48
49     // for tag attribute
50
public void setEnd(int end) throws JspTagException JavaDoc {
51         this.endSpecified = true;
52         this.end = end;
53         validateEnd();
54     }
55
56     // for tag attribute
57
public void setStep(int step) throws JspTagException JavaDoc {
58         this.stepSpecified = true;
59         this.step = step;
60         validateStep();
61     }
62
63     public void setItems(Object JavaDoc o) throws JspTagException JavaDoc {
64     // for null items, simulate an empty list
65
if (o == null)
66         rawItems = new ArrayList JavaDoc();
67         else
68         rawItems = o;
69     }
70 }
71
Popular Tags