svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / ExpressionBuilder.java @ 43020
History | View | Annotate | Download (8.98 KB)
1 | 43020 | jjdelcerro | package org.gvsig.fmap.dal; |
---|---|---|---|
2 | |||
3 | import java.beans.Expression; |
||
4 | import java.util.List; |
||
5 | import org.cresques.cts.IProjection; |
||
6 | import org.gvsig.fmap.geom.Geometry; |
||
7 | |||
8 | public interface ExpressionBuilder { |
||
9 | |||
10 | public enum GeometrySupportType { |
||
11 | WKT, |
||
12 | WKB, |
||
13 | EWKB |
||
14 | } |
||
15 | |||
16 | public enum ParameterType { |
||
17 | Variable, |
||
18 | Constant, |
||
19 | Geometry |
||
20 | } |
||
21 | |||
22 | public interface VisitorFilter { |
||
23 | boolean accept(Visitable visitable);
|
||
24 | } |
||
25 | |||
26 | public interface Visitor { |
||
27 | public void visit(Visitable value); |
||
28 | } |
||
29 | |||
30 | public interface Visitable { |
||
31 | public void accept(Visitor visitor, VisitorFilter filter); |
||
32 | } |
||
33 | |||
34 | public interface Config { |
||
35 | public final static String has_spatial_functions = "has_spatial_functions"; |
||
36 | public final static String quote_for_identifiers = "quote_for_identifiers"; |
||
37 | public final static String quote_for_strings = "quote_for_strings"; |
||
38 | public final static String geometry_type_support = "geometry_type_support"; |
||
39 | public final static String constant_true = "constant_true"; |
||
40 | public final static String constant_false = "constant_false"; |
||
41 | public final static String group = "group"; |
||
42 | public final static String attribute_crs = "crs"; |
||
43 | |||
44 | public final static String Find_SRID = "Find_SRID"; |
||
45 | public final static String ST_SRID = "ST_SRID"; |
||
46 | public final static String ST_AsText = "ST_AsText"; |
||
47 | public final static String ST_AsBinary = "ST_AsBinary"; |
||
48 | public final static String ST_AsEWKB = "ST_AsEWKB"; |
||
49 | public final static String ST_Contains = "ST_Contains"; |
||
50 | public final static String ST_Crosses = "ST_Crosses"; |
||
51 | public final static String ST_Disjoint = "ST_Disjoint"; |
||
52 | public final static String ST_IsClosed = "ST_IsClosed"; |
||
53 | public final static String ST_Overlaps = "ST_Overlaps"; |
||
54 | public final static String ST_Touches = "ST_Touches"; |
||
55 | public final static String ST_Within = "ST_Within"; |
||
56 | public final static String ST_Intersects = "ST_Intersects"; |
||
57 | public final static String ST_Envelope = "ST_Envelope"; |
||
58 | public final static String ST_GeomFromText = "ST_GeomFromText"; |
||
59 | public final static String ST_GeomFromWKB = "ST_GeomFromWKB"; |
||
60 | public final static String ST_GeomFromEWKB = "ST_GeomFromEWKB"; |
||
61 | public final static String lcase = "lcase"; |
||
62 | public final static String ucase = "ucase"; |
||
63 | public final static String isNull = "isNull"; |
||
64 | public final static String notIsNull = "notIsNull"; |
||
65 | public final static String operator_not = "operator_not"; |
||
66 | |||
67 | public final static String operator_AND = "operator_AND"; |
||
68 | public final static String operator_OR = "operator_OR"; |
||
69 | public final static String operator_EQ = "operator_EQ"; |
||
70 | public final static String operator_NE = "operator_NE"; |
||
71 | public final static String operator_GT = "operator_GT"; |
||
72 | public final static String operator_GE = "operator_GE"; |
||
73 | public final static String operator_LT = "operator_LT"; |
||
74 | public final static String operator_LE = "operator_LE"; |
||
75 | public final static String operator_LIKE = "operator_LIKE"; |
||
76 | public final static String operator_ILIKE = "operator_ILIKE"; |
||
77 | |||
78 | public final static String operator_add = "operator_add"; |
||
79 | public final static String operator_subst = "operator_subst"; |
||
80 | public final static String operator_mult = "operator_mult"; |
||
81 | public final static String operator_div = "operator_div"; |
||
82 | public final static String operator_concat = "operator_concat"; |
||
83 | |||
84 | |||
85 | public GeometrySupportType getGeometryTypeSupport();
|
||
86 | public boolean has_spatial_functions(); |
||
87 | public boolean has_functionality(String functionality); |
||
88 | public void remove_functionality(String functionality); |
||
89 | |||
90 | public boolean getBoolean(String name); |
||
91 | public String getString(String name); |
||
92 | public Object get(String name); |
||
93 | public void set(String name, Object value); |
||
94 | } |
||
95 | |||
96 | public interface Value extends Visitable { |
||
97 | |||
98 | } |
||
99 | |||
100 | public interface Group extends Value { |
||
101 | public Value getValue();
|
||
102 | } |
||
103 | |||
104 | public interface Constant extends Value { |
||
105 | public Object getValue(); |
||
106 | } |
||
107 | |||
108 | public interface Custom extends Value { |
||
109 | public Object getValue(); |
||
110 | public Custom add(Variable variable);
|
||
111 | public Custom add(Parameter parameter);
|
||
112 | } |
||
113 | |||
114 | public interface GeometryValue extends Value { |
||
115 | public Geometry getGeometry();
|
||
116 | public IProjection getSRS();
|
||
117 | } |
||
118 | |||
119 | public interface Variable extends Value, Comparable<Variable> { |
||
120 | public String getName(); |
||
121 | } |
||
122 | |||
123 | public interface Parameter extends Value { |
||
124 | public Parameter as_geometry();
|
||
125 | public Parameter as_constant();
|
||
126 | public Parameter as_variable();
|
||
127 | public Parameter srs(Value srs);
|
||
128 | public Parameter srs(IProjection srs);
|
||
129 | public String getName(); |
||
130 | public Object getValue(); |
||
131 | public ParameterType getType();
|
||
132 | public Value getSRS();
|
||
133 | public boolean is_constant(); |
||
134 | public boolean is_variable(); |
||
135 | public boolean is_geometry_variable(); |
||
136 | } |
||
137 | |||
138 | public interface Function extends Value { |
||
139 | public String getName(); |
||
140 | public List<Value> parameters(); |
||
141 | public Function parameter(Value parameter);
|
||
142 | } |
||
143 | |||
144 | public interface BinaryOperator extends Value { |
||
145 | public String getName(); |
||
146 | public Value getLeft();
|
||
147 | public Value getRight();
|
||
148 | public BinaryOperator setLeft(Value operand);
|
||
149 | public BinaryOperator setRight(Value operand);
|
||
150 | } |
||
151 | |||
152 | public void accept(Visitor visitor, VisitorFilter filter); |
||
153 | |||
154 | public List<Variable> getVariables(); |
||
155 | |||
156 | public List<Parameter> getParameters(); |
||
157 | |||
158 | public boolean has_spatial_functions(); |
||
159 | |||
160 | public GeometrySupportType geometry_support_type();
|
||
161 | |||
162 | public String identifier(String name); |
||
163 | |||
164 | public String bytearray(byte[] data); |
||
165 | |||
166 | public String string(String s); |
||
167 | |||
168 | public int getSRSId(IProjection projection); |
||
169 | |||
170 | public Config getConfig();
|
||
171 | |||
172 | public Value getValue();
|
||
173 | |||
174 | public ExpressionBuilder setValue(Value value);
|
||
175 | |||
176 | public Variable variable(String name); |
||
177 | |||
178 | public Variable column(String name); // Alias for variable(name) |
||
179 | |||
180 | public Parameter parameter(Object value); |
||
181 | |||
182 | public Constant constant(Object value); |
||
183 | |||
184 | public Group group(Value group); |
||
185 | |||
186 | public GeometryValue geometry(Geometry geom, IProjection projection);
|
||
187 | |||
188 | public Custom custom(Object value); |
||
189 | |||
190 | public Constant srs(IProjection projection);
|
||
191 | |||
192 | public Function getAsGeometry(Value value);
|
||
193 | |||
194 | |||
195 | public Function not(Value value);
|
||
196 | |||
197 | public Function notIsNull(Value value);
|
||
198 | |||
199 | public Function isNull(Value value);
|
||
200 | |||
201 | public Function Find_SRID(Value schema, Value table, Value column);
|
||
202 | |||
203 | public Function ST_SRID(Value geom);
|
||
204 | |||
205 | public Function ST_AsText(Value geom);
|
||
206 | |||
207 | public Function ST_AsBinary(Value geom);
|
||
208 | |||
209 | public Function ST_AsEWKB(Value geom);
|
||
210 | |||
211 | public Function ST_Envelope(Value geom);
|
||
212 | |||
213 | public Function ST_GeomFromText(Value geom, Value crs);
|
||
214 | |||
215 | public Function ST_GeomFromWKB(Value geom, Value crs);
|
||
216 | |||
217 | public Function ST_GeomFromEWKB(Value geom, Value crs);
|
||
218 | |||
219 | public Function ST_Intersects(Value geom1, Value geom2);
|
||
220 | |||
221 | public Function ST_Contains(Value geom1, Value geom2);
|
||
222 | |||
223 | public Function ST_Crosses(Value geom1, Value geom2);
|
||
224 | |||
225 | public Function ST_IsClosed(Value geom1);
|
||
226 | |||
227 | public Function ST_Overlaps(Value geom1, Value geom2);
|
||
228 | |||
229 | public Function ST_Touches(Value geom1, Value geom2);
|
||
230 | |||
231 | public Function ST_Within(Value geom1, Value geom2);
|
||
232 | |||
233 | public Function lcase(Value s);
|
||
234 | |||
235 | public Function ucase(Value s);
|
||
236 | |||
237 | public BinaryOperator and(Value op1, Value op2);
|
||
238 | |||
239 | public BinaryOperator or(Value op1, Value op2);
|
||
240 | |||
241 | public BinaryOperator eq(Value op1, Value op2);
|
||
242 | |||
243 | public BinaryOperator ne(Value op1, Value op2);
|
||
244 | |||
245 | public BinaryOperator gt(Value op1, Value op2);
|
||
246 | |||
247 | public BinaryOperator ge(Value op1, Value op2);
|
||
248 | |||
249 | public BinaryOperator lt(Value op1, Value op2);
|
||
250 | |||
251 | public BinaryOperator le(Value op1, Value op2);
|
||
252 | |||
253 | public BinaryOperator like(Value op1, Value op2);
|
||
254 | |||
255 | public BinaryOperator ilike(Value op1, Value op2);
|
||
256 | |||
257 | public BinaryOperator add(Value op1, Value op2);
|
||
258 | |||
259 | public BinaryOperator subst(Value op1, Value op2);
|
||
260 | |||
261 | public BinaryOperator mult(Value op1, Value op2);
|
||
262 | |||
263 | public BinaryOperator div(Value op1, Value op2);
|
||
264 | |||
265 | public BinaryOperator concat(Value op1, Value op2);
|
||
266 | |||
267 | public ExpressionBuilder set(Value value);
|
||
268 | |||
269 | public ExpressionBuilder and(Value value);
|
||
270 | |||
271 | public ExpressionBuilder or(Value value);
|
||
272 | |||
273 | public ExpressionBuilder createExpressionBuilder();
|
||
274 | } |