KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > forms > binding > Binding


1 /*
2  * Copyright 1999-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.cocoon.forms.binding;
17
18 import org.apache.cocoon.forms.binding.library.Library;
19 import org.apache.cocoon.forms.formmodel.Widget;
20
21 /**
22  * Binding declares the methods to 'bind' (i.e. 'load' and 'save')
23  * information elements from some back-end model (2nd argument) to and from
24  * a existing Cocoon Form Widget.
25  *
26  * @version $Id: Binding.java 289538 2005-09-16 13:46:22Z sylvain $
27  */

28 public interface Binding {
29
30     /**
31      * Sets parent binding.
32      * @param binding Parent of this binding.
33      */

34     void setParent(Binding binding);
35
36     /**
37      * Gets binding definition id.
38      */

39     String JavaDoc getId();
40     
41     /**
42      * returns the local library for this tree of bindings
43      */

44     Library getLocalLibrary();
45     
46     /**
47      * checks for deep validity of this binding tree (taking into accound included libraries)
48      */

49     boolean isValid();
50
51     /**
52      * Gets a binding class.
53      * @param id Id of binding class to get.
54      */

55     Binding getClass(String JavaDoc id);
56
57     /**
58      * Loads the information-elements from the objModel to the frmModel.
59      *
60      * @param frmModel
61      * @param objModel
62      */

63     void loadFormFromModel(Widget frmModel, Object JavaDoc objModel)
64             throws BindingException;
65
66     /**
67      * Saves the infortmation-elements to the objModel from the frmModel.
68      * @param frmModel
69      * @param objModel
70      */

71     void saveFormToModel(Widget frmModel, Object JavaDoc objModel)
72             throws BindingException;
73 }
74
Popular Tags