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.PropertyIsEqualTo;
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:PropertyIsEqualTo.
28: *
29: * <p>
30: * <pre>
31: * <code>
32: * <xsd:element name="PropertyIsEqualTo"
33: * substitutionGroup="ogc:comparisonOps" type="ogc:BinaryComparisonOpType"/>
34: *
35: * </code>
36: * </pre>
37: * </p>
38: *
39: * @generated
40: */
41: public class OGCPropertyIsEqualToBinding extends AbstractComplexBinding {
42: FilterFactory filterfactory;
43:
44: public OGCPropertyIsEqualToBinding(FilterFactory filterfactory) {
45: this .filterfactory = filterfactory;
46: }
47:
48: /**
49: * @generated
50: */
51: public QName getTarget() {
52: return OGC.PropertyIsEqualTo;
53: }
54:
55: /**
56: * <!-- begin-user-doc -->
57: * <!-- end-user-doc -->
58: *
59: * @generated modifiable
60: */
61: public Class getType() {
62: return PropertyIsEqualTo.class;
63: }
64:
65: public int getExecutionMode() {
66: return AFTER;
67: }
68:
69: /**
70: * <!-- begin-user-doc -->
71: * <!-- end-user-doc -->
72: *
73: * @generated modifiable
74: */
75: public Object parse(ElementInstance instance, Node node,
76: Object value) throws Exception {
77: Expression e1 = (Expression) node.getChildValue(0);
78: Expression e2 = (Expression) node.getChildValue(1);
79:
80: //<xsd:attribute default="true" name="matchCase" type="xsd:boolean" use="optional"/>
81: Boolean matchCase = Boolean.TRUE;
82:
83: if (node.hasAttribute("matchCase")) {
84: matchCase = (Boolean) node.getAttributeValue("matchCase");
85: }
86:
87: return filterfactory.equal(e1, e2, matchCase.booleanValue());
88: }
89: }
|