01: package org.geotools.filter.function;
02:
03: /*
04: * GeoTools - OpenSource mapping toolkit
05: * http://geotools.org
06: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Lesser General Public
10: * License as published by the Free Software Foundation;
11: * version 2.1 of the License.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Lesser General Public License for more details.
17: */
18:
19: //this code is autogenerated - you shouldnt be modifying it!
20: import org.geotools.filter.FunctionExpression;
21: import org.geotools.filter.FunctionExpressionImpl;
22:
23: public class FilterFunction_strReplace extends FunctionExpressionImpl
24: implements FunctionExpression {
25:
26: public FilterFunction_strReplace() {
27: super ("strReplace");
28: }
29:
30: public int getArgCount() {
31: return 4;
32: }
33:
34: public Object evaluate(Object feature) {
35: String arg0;
36: String arg1;
37: String arg2;
38: Boolean arg3;
39:
40: try { // attempt to get value and perform conversion
41: arg0 = (String) getExpression(0).evaluate(feature,
42: String.class); // extra
43: // protection
44: // for
45: // strings
46: } catch (Exception e) // probably a type error
47: {
48: throw new IllegalArgumentException(
49: "Filter Function problem for function strMatches argument #0 - expected type String");
50: }
51:
52: try { // attempt to get value and perform conversion
53: arg1 = (String) getExpression(1).evaluate(feature,
54: String.class); // extra
55: // protection
56: // for
57: // strings
58: } catch (Exception e) // probably a type error
59: {
60: throw new IllegalArgumentException(
61: "Filter Function problem for function strMatches argument #1 - expected type String");
62: }
63:
64: try { // attempt to get value and perform conversion
65: arg2 = (String) getExpression(2).evaluate(feature,
66: String.class); // extra
67: // protection
68: // for
69: // strings
70: } catch (Exception e) // probably a type error
71: {
72: throw new IllegalArgumentException(
73: "Filter Function problem for function strMatches argument #1 - expected type String");
74: }
75:
76: try { // attempt to get value and perform conversion
77: arg3 = (Boolean) getExpression(3).evaluate(feature,
78: Boolean.class); // extra
79: // protection
80: // for
81: // strings
82: } catch (Exception e) // probably a type error
83: {
84: arg3 = Boolean.FALSE;
85: }
86:
87: return StaticGeometry.strReplace(arg0, arg1, arg2, arg3);
88: }
89: }
|