01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.filter.v1_0;
17:
18: import javax.xml.namespace.QName;
19: import org.opengis.filter.FilterFactory;
20: import org.opengis.filter.expression.Add;
21: import org.opengis.filter.expression.Expression;
22: import org.geotools.xml.AbstractComplexBinding;
23: import org.geotools.xml.ElementInstance;
24: import org.geotools.xml.Node;
25:
26: /**
27: * Binding object for the element http://www.opengis.net/ogc:Add.
28: *
29: * <p>
30: * <pre>
31: * <code>
32: * <xsd:element name="Add" substitutionGroup="ogc:expression" type="ogc:BinaryOperatorType"/>
33: *
34: * </code>
35: * </pre>
36: * </p>
37: *
38: * @generated
39: */
40: public class OGCAddBinding extends AbstractComplexBinding {
41: FilterFactory filterfactory;
42:
43: public OGCAddBinding(FilterFactory filterfactory) {
44: this .filterfactory = filterfactory;
45: }
46:
47: /**
48: * @generated
49: */
50: public QName getTarget() {
51: return OGC.Add;
52: }
53:
54: /**
55: * <!-- begin-user-doc -->
56: * <!-- end-user-doc -->
57: *
58: * @generated modifiable
59: */
60: public Class getType() {
61: return Add.class;
62: }
63:
64: public int getExecutionMode() {
65: return AFTER;
66: }
67:
68: /**
69: * <!-- begin-user-doc -->
70: * <!-- end-user-doc -->
71: *
72: * @generated modifiable
73: */
74: public Object parse(ElementInstance instance, Node node,
75: Object value) throws Exception {
76: return filterfactory.add((Expression) node.getChildValue(0),
77: (Expression) node.getChildValue(1));
78: }
79: }
|