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 com.vividsolutions.jts.geom.GeometryFactory;
20: import org.opengis.filter.FilterFactory2;
21: import org.opengis.filter.expression.Expression;
22: import org.opengis.filter.spatial.Crosses;
23: import org.geotools.xml.AbstractComplexBinding;
24: import org.geotools.xml.ElementInstance;
25: import org.geotools.xml.Node;
26:
27: /**
28: * Binding object for the element http://www.opengis.net/ogc:Crosses.
29: *
30: * <p>
31: * <pre>
32: * <code>
33: * <xsd:element name="Crosses" substitutionGroup="ogc:spatialOps" type="ogc:BinarySpatialOpType"/>
34: *
35: * </code>
36: * </pre>
37: * </p>
38: *
39: * @generated
40: */
41: public class OGCCrossesBinding extends AbstractComplexBinding {
42: FilterFactory2 filterFactory;
43: GeometryFactory geometryFactory;
44:
45: public OGCCrossesBinding(FilterFactory2 filterFactory,
46: GeometryFactory geometryFactory) {
47: this .filterFactory = filterFactory;
48: this .geometryFactory = geometryFactory;
49: }
50:
51: /**
52: * @generated
53: */
54: public QName getTarget() {
55: return OGC.Crosses;
56: }
57:
58: /**
59: * <!-- begin-user-doc -->
60: * <!-- end-user-doc -->
61: *
62: * @generated modifiable
63: */
64: public Class getType() {
65: return Crosses.class;
66: }
67:
68: public int getExecutionMode() {
69: return AFTER;
70: }
71:
72: /**
73: * <!-- begin-user-doc -->
74: * <!-- end-user-doc -->
75: *
76: * @generated modifiable
77: */
78: public Object parse(ElementInstance instance, Node node,
79: Object value) throws Exception {
80: Expression[] operands = OGCUtils.spatial(node, filterFactory,
81: geometryFactory);
82:
83: return filterFactory.crosses(operands[0], operands[1]);
84: }
85: }
|