KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > woody > binding > ClassJXPathBinding


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.woody.binding;
17
18 import org.apache.cocoon.woody.formmodel.Widget;
19 import org.apache.commons.jxpath.JXPathContext;
20
21 /**
22  * ClassJXPathBinding provides an implementation of a {@link Binding}
23  * that that allows the specification of a class of reusable bindings.
24  * <p>
25  * NOTES: <ol>
26  * <li>This Binding uses the provided widget-id as the name for the class.</li>
27  * </ol>
28  *
29  * @author Timothy Larson
30  * @version CVS $Id: ClassJXPathBinding.java 30932 2004-07-29 17:35:38Z vgritsenko $
31  */

32 public class ClassJXPathBinding extends ComposedJXPathBindingBase {
33
34     private final String JavaDoc widgetId;
35
36     /**
37      * Constructs ClassJXPathBinding
38      * @param commonAtts
39      * @param widgetId
40      * @param childBindings
41      */

42     public ClassJXPathBinding(JXPathBindingBuilderBase.CommonAttributes commonAtts, String JavaDoc widgetId, JXPathBindingBase[] childBindings) {
43         super(commonAtts, childBindings);
44         this.widgetId = widgetId;
45     }
46
47     /**
48      * Returns binding definition id.
49      */

50     public String JavaDoc getId() {
51         return widgetId;
52     }
53
54     /**
55      * Narrows the scope on the form-model to the member widget-field, and
56      * narrows the scope on the object-model to the member xpath-context
57      * before continuing the binding over the child-bindings.
58      */

59     public void doLoad(Widget frmModel, JXPathContext jxpc) {
60         // Do nothing
61
}
62
63     /**
64      * Narrows the scope on the form-model to the member widget-field, and
65      * narrows the scope on the object-model to the member xpath-context
66      * before continuing the binding over the child-bindings.
67      */

68     public void doSave(Widget frmModel, JXPathContext jxpc) throws BindingException {
69         // Do nothing
70
}
71
72     public String JavaDoc toString() {
73         return "ClassJXPathBinding [widget=" + this.widgetId + "]";
74     }
75 }
76
Popular Tags