01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.markup.html.form.persistence;
18:
19: import org.apache.wicket.IClusterable;
20: import org.apache.wicket.markup.html.form.FormComponent;
21:
22: /**
23: * Wicket users and developers should not need to care about where or how form
24: * values are saved. An implementer of IValuePersister persister is responsible
25: * for storing and retrieving FormComponent values. Different means of storing
26: * values for form components may be implemented. CookieValuePersister, for
27: * example, uses an HTTP cookie to persist the value of a form component. Other
28: * implementations may instead persist form values to server-side storage for
29: * security reasons.
30: *
31: * @author Juergen Donnerstag
32: * @author Jonathan Locke
33: */
34: public interface IValuePersister extends IClusterable {
35: /**
36: * Saves the current value of the given form component
37: *
38: * @param component
39: * The form component
40: */
41: void save(FormComponent component);
42:
43: /**
44: * Loads any persisted value for a given form component
45: *
46: * @param component
47: * The form component
48: */
49: void load(FormComponent component);
50:
51: /**
52: * Remove any persisted value for a given form component.
53: *
54: * @param component
55: * The form component
56: */
57: void clear(FormComponent component);
58: }
|