Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TransientStateHelper |
|
| 1.0;1 |
1 | /* | |
2 | * Licensed to the Apache Software Foundation (ASF) under one | |
3 | * or more contributor license agreements. See the NOTICE file | |
4 | * distributed with this work for additional information | |
5 | * regarding copyright ownership. The ASF licenses this file | |
6 | * to you under the Apache License, Version 2.0 (the | |
7 | * "License"); you may not use this file except in compliance | |
8 | * with the License. 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, | |
13 | * software distributed under the License is distributed on an | |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
15 | * KIND, either express or implied. See the License for the | |
16 | * specific language governing permissions and limitations | |
17 | * under the License. | |
18 | */ | |
19 | package javax.faces.component; | |
20 | ||
21 | ||
22 | /** | |
23 | * <p>Define a <code>Map</code>-like contract | |
24 | * that makes it easier for components to implement {@link | |
25 | * TransientStateHolder}. Each {@link UIComponent} in the view will | |
26 | * return an implementation of this interface from its {@link | |
27 | * UIComponent#getTransientStateHelper} method.</p> | |
28 | * | |
29 | * <p>The values retrieved or saved through | |
30 | * {@link #getTransient(java.io.Serializable)} } or | |
31 | * {@link #putTransient(java.io.Serializable, Object value)} } | |
32 | * will not be preserved between requests.</p> | |
33 | * | |
34 | * @since 2.1 | |
35 | */ | |
36 | public interface TransientStateHelper extends TransientStateHolder | |
37 | { | |
38 | /** | |
39 | * <p>Return the value currently | |
40 | * associated with the specified <code>key</code> if any.</p> | |
41 | * | |
42 | * @param key the key for which the value should be returned. | |
43 | * @since 2.1 | |
44 | */ | |
45 | public Object getTransient(Object key); | |
46 | ||
47 | /** | |
48 | * <p>Performs the same logic as {@link | |
49 | * #getTransient(java.io.Serializable)} } but if no value is found, this | |
50 | * will return the specified <code>defaultValue</code></p> | |
51 | ||
52 | * @param key the key for which the value should be returned. | |
53 | * @param defaultValue the value to return if no value is found in | |
54 | * the call to <code>get()</code>. | |
55 | * @since 2.1 | |
56 | */ | |
57 | public Object getTransient(Object key, Object defaultValue); | |
58 | ||
59 | /** | |
60 | * <p>Return the previously stored value | |
61 | * and store the specified key/value pair. This is intended to | |
62 | * store data that would otherwise reside in an instance variable on | |
63 | * the component.</p> | |
64 | * | |
65 | * @param key the key for the value | |
66 | * @param value the value | |
67 | * @since 2.1 | |
68 | */ | |
69 | public Object putTransient(Object key, Object value); | |
70 | ||
71 | } |