Skip to content

Package: DynamicAttributes

DynamicAttributes

Coverage

1: /*
2: * Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: * Copyright 2004 The Apache Software Foundation
5: *
6: * Licensed under the Apache License, Version 2.0 (the "License");
7: * you may not use this file except in compliance with the License.
8: * You may obtain a copy of the License at
9: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: package jakarta.servlet.jsp.tagext;
20:
21: import jakarta.servlet.jsp.JspException;
22:
23: /**
24: * For a tag to declare that it accepts dynamic attributes, it must implement this interface. The entry for the tag in
25: * the Tag Library Descriptor must also be configured to indicate dynamic attributes are accepted. <br>
26: * For any attribute that is not declared in the Tag Library Descriptor for this tag, instead of getting an error at
27: * translation time, the <code>setDynamicAttribute()</code> method is called, with the name and value of the attribute.
28: * It is the responsibility of the tag to remember the names and values of the dynamic attributes.
29: *
30: * @since JSP 2.0
31: */
32: public interface DynamicAttributes {
33:
34: /**
35: * Called when a tag declared to accept dynamic attributes is passed an attribute that is not declared in the Tag
36: * Library Descriptor.
37: *
38: * @param uri the namespace of the attribute, or null if in the default namespace.
39: * @param localName the name of the attribute being set.
40: * @param value the value of the attribute
41: * @throws JspException if the tag handler wishes to signal that it does not accept the given attribute. The
42: * container must not call doStartTag() or doTag() for this tag.
43: */
44: public void setDynamicAttribute(String uri, String localName, Object value) throws JspException;
45:
46: }