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.cocoon.forms.binding;
18:
19: import org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant;
20:
21: import org.w3c.dom.Element;
22:
23: /**
24: * DeleteNodeJXPathBindingBuilder provides a helper class for the Factory
25: * implemented in {@link JXPathBindingManager} that helps construct the
26: * actual {@link DeleteNodeJXPathBinding} out of the configuration in the
27: * provided configElement which looks like:
28: * <pre><code>
29: * <fb:delete-node />
30: * </code></pre>
31: *
32: * @version $Id: DeleteNodeJXPathBindingBuilder.java 450255 2006-09-26 23:48:43Z vgritsenko $
33: */
34: public class DeleteNodeJXPathBindingBuilder extends
35: JXPathBindingBuilderBase {
36:
37: /**
38: * Creates an instance of {@link DeleteNodeJXPathBinding}.
39: */
40: public JXPathBindingBase buildBinding(Element bindingElm,
41: Assistant assistant) throws BindingException {
42: CommonAttributes commonAtts = JXPathBindingBuilderBase
43: .getCommonAttributes(bindingElm);
44:
45: // do inheritance
46: DeleteNodeJXPathBinding otherBinding = (DeleteNodeJXPathBinding) assistant
47: .getContext().getSuperBinding();
48: if (otherBinding != null) {
49: commonAtts = JXPathBindingBuilderBase
50: .mergeCommonAttributes(
51: otherBinding.getCommonAtts(), commonAtts);
52: }
53:
54: return new DeleteNodeJXPathBinding(commonAtts);
55: }
56: }
|