KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > attributes > Sealable


1 /*
2  * Copyright 2003-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 package org.apache.commons.attributes;
17
18 /**
19  * Marks an attribute class as being sealable. When an instance of an attribute
20  * class is created it goes through the following phases:
21  *
22  * <ol>
23  * <li>Its constructor is called with all non-named parameters in the attribute declaration.
24  * <li>Its setters are called according to the named parameters in the declaration.
25  * </ol>
26  *
27  * This alone poses a security risk, as a client can call setters on an attribute as well,
28  * and thus make class attributes mutable. In order to notify the attribute class that construction
29  * and initialization is completed, the attribute runtime system will test if it implements Sealable,
30  * and of so, invoke {@link #seal()} on the attribute instance.
31  *
32  * @see DefaultSealable
33  */

34 public interface Sealable {
35     /**
36      * Called to indicate that construction and initialization of this attribute instance
37      * is completed, and that the attribute instance should become read-only.
38      */

39     public void seal ();
40 }
Popular Tags