001    /*
002    * Licensed to the Apache Software Foundation (ASF) under one or more
003    * contributor license agreements.  See the NOTICE file distributed with
004    * this work for additional information regarding copyright ownership.
005    * The ASF licenses this file to You under the Apache License, Version 2.0
006    * (the "License"); you may not use this file except in compliance with
007    * the License.  You may obtain a copy of the License at
008    *
009    *     http://www.apache.org/licenses/LICENSE-2.0
010    *
011    * Unless required by applicable law or agreed to in writing, software
012    * distributed under the License is distributed on an "AS IS" BASIS,
013    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014    * See the License for the specific language governing permissions and
015    * limitations under the License.
016    */
017    package javax.servlet.jsp.tagext;
018    
019    import javax.servlet.jsp.JspException;
020    
021    /**
022     * For a tag to declare that it accepts dynamic attributes, it must implement
023     * this interface.  The entry for the tag in the Tag Library Descriptor must 
024     * also be configured to indicate dynamic attributes are accepted.
025     * <br>
026     * For any attribute that is not declared in the Tag Library Descriptor for
027     * this tag, instead of getting an error at translation time, the 
028     * <code>setDynamicAttribute()</code> method is called, with the name and
029     * value of the attribute.  It is the responsibility of the tag to 
030     * remember the names and values of the dynamic attributes.
031     *
032     * @since 2.0
033     */
034    public interface DynamicAttributes {
035        
036        /**
037         * Called when a tag declared to accept dynamic attributes is passed
038         * an attribute that is not declared in the Tag Library Descriptor.
039         * 
040         * @param uri the namespace of the attribute, or null if in the default
041         *     namespace.
042         * @param localName the name of the attribute being set.
043         * @param value the value of the attribute
044         * @throws JspException if the tag handler wishes to
045         *     signal that it does not accept the given attribute.  The 
046         *     container must not call doStartTag() or doTag() for this tag.
047         */
048        public void setDynamicAttribute(
049            String uri, String localName, Object value ) 
050            throws JspException;
051        
052    }