01 /*
02 * Copyright 2004 The Apache Software Foundation
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
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 package javax.servlet.jsp.tagext;
17
18 import javax.servlet.jsp.JspException;
19
20 /**
21 * For a tag to declare that it accepts dynamic attributes, it must implement
22 * this interface. The entry for the tag in the Tag Library Descriptor must
23 * also be configured to indicate dynamic attributes are accepted.
24 * <br>
25 * For any attribute that is not declared in the Tag Library Descriptor for
26 * this tag, instead of getting an error at translation time, the
27 * <code>setDynamicAttribute()</code> method is called, with the name and
28 * value of the attribute. It is the responsibility of the tag to
29 * remember the names and values of the dynamic attributes.
30 *
31 * @since 2.0
32 */
33 public interface DynamicAttributes {
34
35 /**
36 * Called when a tag declared to accept dynamic attributes is passed
37 * an attribute that is not declared in the Tag Library Descriptor.
38 *
39 * @param uri the namespace of the attribute, or null if in the default
40 * namespace.
41 * @param localName the name of the attribute being set.
42 * @param value the value of the attribute
43 * @throws JspException if the tag handler wishes to
44 * signal that it does not accept the given attribute. The
45 * container must not call doStartTag() or doTag() for this tag.
46 */
47 public void setDynamicAttribute(String uri, String localName,
48 Object value) throws JspException;
49
50 }
|