01: /*
02: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
03: *
04: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Portions Copyright Apache Software Foundation.
07: *
08: * The contents of this file are subject to the terms of either the GNU
09: * General Public License Version 2 only ("GPL") or the Common Development
10: * and Distribution License("CDDL") (collectively, the "License"). You
11: * may not use this file except in compliance with the License. You can obtain
12: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
13: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
14: * language governing permissions and limitations under the License.
15: *
16: * When distributing the software, include this License Header Notice in each
17: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
18: * Sun designates this particular file as subject to the "Classpath" exception
19: * as provided by Sun in the GPL Version 2 section of the License file that
20: * accompanied this code. If applicable, add the following below the License
21: * Header, with the fields enclosed by brackets [] replaced by your own
22: * identifying information: "Portions Copyrighted [year]
23: * [name of copyright owner]"
24: *
25: * Contributor(s):
26: *
27: * If you wish your version of this file to be governed by only the CDDL or
28: * only the GPL Version 2, indicate your decision by adding "[Contributor]
29: * elects to include this software in this distribution under the [CDDL or GPL
30: * Version 2] license." If you don't indicate a single choice of license, a
31: * recipient has the option to distribute your version of this file under
32: * either the CDDL, the GPL Version 2 or to extend the choice of license to
33: * its licensees as provided above. However, if you add GPL Version 2 code
34: * and therefore, elected the GPL Version 2 license, then the option applies
35: * only if the new code is made subject to such option by the copyright
36: * holder.
37: */
38:
39: package org.apache.taglibs.standard.tag.rt.core;
40:
41: import javax.servlet.jsp.JspTagException;
42: import javax.servlet.jsp.jstl.core.LoopTag;
43: import javax.servlet.jsp.tagext.IterationTag;
44:
45: import org.apache.taglibs.standard.tag.common.core.ForTokensSupport;
46:
47: /**
48: * <p>A handler for <forTokens> that supports rtexprvalue-based
49: * attributes.</p>
50: *
51: * @author Shawn Bayern
52: */
53:
54: public class ForTokensTag extends ForTokensSupport implements LoopTag,
55: IterationTag {
56:
57: //*********************************************************************
58: // Accessor methods
59:
60: // for tag attribute
61: public void setBegin(int begin) throws JspTagException {
62: this .beginSpecified = true;
63: this .begin = begin;
64: validateBegin();
65: }
66:
67: // for tag attribute
68: public void setEnd(int end) throws JspTagException {
69: this .endSpecified = true;
70: this .end = end;
71: validateEnd();
72: }
73:
74: // for tag attribute
75: public void setStep(int step) throws JspTagException {
76: this .stepSpecified = true;
77: this .step = step;
78: validateStep();
79: }
80:
81: // stores the 'items' String we're passed
82: public void setItems(Object s) throws JspTagException {
83: items = s;
84: // use the empty string to indicate "no iteration"
85: if (s == null)
86: items = "";
87: }
88:
89: // stores the 'delims' String we're passed
90: public void setDelims(String s) throws JspTagException {
91: delims = s;
92: // use the empty string to cause monolithic tokenization
93: if (s == null)
94: delims = "";
95: }
96:
97: }
|