svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / test / java / org / gvsig / fmap / dal / feature / DummyFetureStore.java @ 44297
History | View | Annotate | Download (16.1 KB)
1 |
|
---|---|
2 |
package org.gvsig.fmap.dal.feature; |
3 |
|
4 |
import java.util.Collection; |
5 |
import java.util.Iterator; |
6 |
import java.util.List; |
7 |
import java.util.Set; |
8 |
|
9 |
import org.cresques.cts.IProjection; |
10 |
import org.gvsig.expressionevaluator.Expression; |
11 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
12 |
|
13 |
import org.gvsig.fmap.dal.DataQuery; |
14 |
import org.gvsig.fmap.dal.DataServerExplorer; |
15 |
import org.gvsig.fmap.dal.DataSet; |
16 |
import org.gvsig.fmap.dal.DataStore; |
17 |
import org.gvsig.fmap.dal.DataStoreParameters; |
18 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
19 |
import org.gvsig.fmap.dal.StoresRepository; |
20 |
import org.gvsig.fmap.dal.exception.DataException; |
21 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
22 |
import org.gvsig.fmap.dal.feature.exception.NeedEditingModeException; |
23 |
import org.gvsig.fmap.geom.SpatialIndex; |
24 |
import org.gvsig.fmap.geom.primitive.Envelope; |
25 |
import org.gvsig.metadata.exceptions.MetadataException; |
26 |
import org.gvsig.timesupport.Interval; |
27 |
import org.gvsig.tools.dynobject.DynClass; |
28 |
import org.gvsig.tools.dynobject.DynObject; |
29 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
30 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
31 |
import org.gvsig.tools.exception.BaseException; |
32 |
import org.gvsig.tools.observer.Observer; |
33 |
import org.gvsig.tools.persistence.PersistentState; |
34 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
35 |
import org.gvsig.tools.undo.RedoException; |
36 |
import org.gvsig.tools.undo.UndoException; |
37 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
38 |
import org.gvsig.tools.resourcesstorage.EmptyResourcesStorage; |
39 |
import org.gvsig.tools.util.UnmodifiableBasicMap; |
40 |
import org.gvsig.tools.visitor.Visitor; |
41 |
|
42 |
/**
|
43 |
* This class is intended to be used in test.
|
44 |
* Use it directly or extend it and overwrite the methods you need.
|
45 |
* This class is maintained as part of the DAL API.
|
46 |
*/
|
47 |
|
48 |
|
49 |
public class DummyFetureStore implements FeatureStore { |
50 |
|
51 |
@Override
|
52 |
public Object clone() throws CloneNotSupportedException { |
53 |
return super.clone(); |
54 |
} |
55 |
|
56 |
@Override
|
57 |
public boolean allowWrite() { |
58 |
return false; |
59 |
} |
60 |
|
61 |
@Override
|
62 |
public FeatureType getDefaultFeatureType() throws DataException { |
63 |
return null; |
64 |
} |
65 |
|
66 |
@Override
|
67 |
public FeatureType getFeatureType(String featureTypeId) throws DataException { |
68 |
return null; |
69 |
} |
70 |
|
71 |
@Override
|
72 |
public List getFeatureTypes() throws DataException { |
73 |
return null; |
74 |
} |
75 |
|
76 |
@Override
|
77 |
public DataStoreParameters getParameters() {
|
78 |
return null; |
79 |
} |
80 |
|
81 |
@Override
|
82 |
public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException { |
83 |
return false; |
84 |
} |
85 |
|
86 |
@Override
|
87 |
public Envelope getEnvelope() throws DataException { |
88 |
return null; |
89 |
} |
90 |
|
91 |
@Override
|
92 |
public IProjection getSRSDefaultGeometry() throws DataException { |
93 |
return null; |
94 |
} |
95 |
|
96 |
@Override
|
97 |
public void export(DataServerExplorer explorer, String provider, NewFeatureStoreParameters params) throws DataException { |
98 |
|
99 |
} |
100 |
|
101 |
@Override
|
102 |
public FeatureSet getFeatureSet() throws DataException { |
103 |
return null; |
104 |
} |
105 |
|
106 |
@Override
|
107 |
public FeatureSet getFeatureSet(FeatureQuery featureQuery) throws DataException { |
108 |
return null; |
109 |
} |
110 |
|
111 |
@Override
|
112 |
public void getFeatureSet(FeatureQuery featureQuery, Observer observer) throws DataException { |
113 |
|
114 |
} |
115 |
|
116 |
@Override
|
117 |
public void getFeatureSet(Observer observer) throws DataException { |
118 |
|
119 |
} |
120 |
|
121 |
@Override
|
122 |
public List<Feature> getFeatures(FeatureQuery query, int pageSize) { |
123 |
return null; |
124 |
} |
125 |
|
126 |
@Override
|
127 |
public Feature getFeatureByReference(FeatureReference reference) throws DataException { |
128 |
return null; |
129 |
} |
130 |
|
131 |
@Override
|
132 |
public Feature getFeatureByReference(FeatureReference reference, FeatureType featureType) throws DataException { |
133 |
return null; |
134 |
} |
135 |
|
136 |
@Override
|
137 |
public void edit() throws DataException { |
138 |
|
139 |
} |
140 |
|
141 |
@Override
|
142 |
public void edit(int mode) throws DataException { |
143 |
|
144 |
} |
145 |
|
146 |
@Override
|
147 |
public void cancelEditing() throws DataException { |
148 |
|
149 |
} |
150 |
|
151 |
@Override
|
152 |
public void finishEditing() throws DataException { |
153 |
|
154 |
} |
155 |
|
156 |
@Override
|
157 |
public void commitChanges() throws DataException { |
158 |
|
159 |
} |
160 |
|
161 |
@Override
|
162 |
public boolean canCommitChanges() throws DataException { |
163 |
return false; |
164 |
} |
165 |
|
166 |
@Override
|
167 |
public boolean isEditing() { |
168 |
return false; |
169 |
} |
170 |
|
171 |
@Override
|
172 |
public boolean isAppending() { |
173 |
return false; |
174 |
} |
175 |
|
176 |
@Override
|
177 |
public void update(EditableFeatureType featureType) throws DataException { |
178 |
|
179 |
} |
180 |
|
181 |
@Override
|
182 |
public void update(EditableFeature feature) throws DataException { |
183 |
|
184 |
} |
185 |
|
186 |
@Override
|
187 |
public void delete(Feature feature) throws DataException { |
188 |
|
189 |
} |
190 |
|
191 |
@Override
|
192 |
public void insert(EditableFeature feature) throws DataException { |
193 |
|
194 |
} |
195 |
|
196 |
@Override
|
197 |
public EditableFeature createNewFeature() throws DataException { |
198 |
return null; |
199 |
} |
200 |
|
201 |
@Override
|
202 |
public EditableFeature createNewFeature(FeatureType type, Feature defaultValues) throws DataException { |
203 |
return null; |
204 |
} |
205 |
|
206 |
@Override
|
207 |
public EditableFeature createNewFeature(FeatureType type, boolean defaultValues) throws DataException { |
208 |
return null; |
209 |
} |
210 |
|
211 |
@Override
|
212 |
public EditableFeature createNewFeature(boolean defaultValues) throws DataException { |
213 |
return null; |
214 |
} |
215 |
|
216 |
@Override
|
217 |
public EditableFeature createNewFeature(Feature defaultValues) throws DataException { |
218 |
return null; |
219 |
} |
220 |
|
221 |
@Override
|
222 |
public void validateFeatures(int mode) throws DataException { |
223 |
|
224 |
} |
225 |
|
226 |
@Override
|
227 |
public boolean isAppendModeSupported() { |
228 |
return false; |
229 |
} |
230 |
|
231 |
@Override
|
232 |
public void beginEditingGroup(String description) throws NeedEditingModeException { |
233 |
|
234 |
} |
235 |
|
236 |
@Override
|
237 |
public void endEditingGroup() throws NeedEditingModeException { |
238 |
|
239 |
} |
240 |
|
241 |
@Override
|
242 |
public FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName) throws DataException { |
243 |
return null; |
244 |
} |
245 |
|
246 |
@Override
|
247 |
public FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName) throws DataException { |
248 |
return null; |
249 |
} |
250 |
|
251 |
@Override
|
252 |
public FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName, Observer observer) throws DataException { |
253 |
return null; |
254 |
} |
255 |
|
256 |
@Override
|
257 |
public FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName, Observer observer) throws DataException { |
258 |
return null; |
259 |
} |
260 |
|
261 |
@Override
|
262 |
public FeatureIndexes getIndexes() {
|
263 |
return null; |
264 |
} |
265 |
|
266 |
@Override
|
267 |
public void setSelection(FeatureSet selection) throws DataException { |
268 |
|
269 |
} |
270 |
|
271 |
@Override
|
272 |
public FeatureSelection createFeatureSelection() throws DataException { |
273 |
return null; |
274 |
} |
275 |
|
276 |
@Override
|
277 |
public FeatureSelection getFeatureSelection() throws DataException { |
278 |
return null; |
279 |
} |
280 |
|
281 |
@Override
|
282 |
public boolean isLocksSupported() { |
283 |
return false; |
284 |
} |
285 |
|
286 |
@Override
|
287 |
public FeatureLocks getLocks() throws DataException { |
288 |
return null; |
289 |
} |
290 |
|
291 |
@Override
|
292 |
public FeatureStoreTransforms getTransforms() {
|
293 |
return null; |
294 |
} |
295 |
|
296 |
@Override
|
297 |
public FeatureQuery createFeatureQuery() {
|
298 |
return null; |
299 |
} |
300 |
|
301 |
@Override
|
302 |
public long getFeatureCount() throws DataException { |
303 |
return 0; |
304 |
} |
305 |
|
306 |
// @Override
|
307 |
// public void createCache(String name, DynObject parameters) throws DataException {
|
308 |
//
|
309 |
// }
|
310 |
//
|
311 |
// @Override
|
312 |
// public FeatureCache getCache() {
|
313 |
// return null;
|
314 |
// }
|
315 |
|
316 |
@Override
|
317 |
public boolean isKnownEnvelope() { |
318 |
return false; |
319 |
} |
320 |
|
321 |
@Override
|
322 |
public boolean hasRetrievedFeaturesLimit() { |
323 |
return false; |
324 |
} |
325 |
|
326 |
@Override
|
327 |
public int getRetrievedFeaturesLimit() { |
328 |
return 0; |
329 |
} |
330 |
|
331 |
@Override
|
332 |
public Feature getFeature(DynObject dynobject) {
|
333 |
return null; |
334 |
} |
335 |
|
336 |
@Override
|
337 |
public Iterator iterator() { |
338 |
return null; |
339 |
} |
340 |
|
341 |
@Override
|
342 |
public String getName() { |
343 |
return null; |
344 |
} |
345 |
|
346 |
@Override
|
347 |
public String getFullName() { |
348 |
return null; |
349 |
} |
350 |
|
351 |
@Override
|
352 |
public String getProviderName() { |
353 |
return null; |
354 |
} |
355 |
|
356 |
@Override
|
357 |
public void refresh() throws DataException { |
358 |
|
359 |
} |
360 |
|
361 |
@Override
|
362 |
public DataSet getDataSet() throws DataException { |
363 |
return null; |
364 |
} |
365 |
|
366 |
@Override
|
367 |
public DataSet getDataSet(DataQuery dataQuery) throws DataException { |
368 |
return null; |
369 |
} |
370 |
|
371 |
@Override
|
372 |
public void accept(Visitor visitor) throws BaseException { |
373 |
|
374 |
} |
375 |
|
376 |
@Override
|
377 |
public void accept(Visitor visitor, DataQuery dataQuery) throws BaseException { |
378 |
|
379 |
} |
380 |
|
381 |
@Override
|
382 |
public void getDataSet(Observer observer) throws DataException { |
383 |
|
384 |
} |
385 |
|
386 |
@Override
|
387 |
public void getDataSet(DataQuery dataQuery, Observer observer) throws DataException { |
388 |
|
389 |
} |
390 |
|
391 |
@Override
|
392 |
public DataSet getSelection() throws DataException { |
393 |
return null; |
394 |
} |
395 |
|
396 |
@Override
|
397 |
public void setSelection(DataSet selection) throws DataException { |
398 |
|
399 |
} |
400 |
|
401 |
@Override
|
402 |
public DataSet createSelection() throws DataException { |
403 |
return null; |
404 |
} |
405 |
|
406 |
@Override
|
407 |
public DataServerExplorer getExplorer() throws DataException, ValidateDataParametersException { |
408 |
return null; |
409 |
} |
410 |
|
411 |
@Override
|
412 |
public DataQuery createQuery() {
|
413 |
return null; |
414 |
} |
415 |
|
416 |
@Override
|
417 |
public Interval getInterval() {
|
418 |
return null; |
419 |
} |
420 |
|
421 |
@Override
|
422 |
public Collection getTimes() { |
423 |
return null; |
424 |
} |
425 |
|
426 |
@Override
|
427 |
public Collection getTimes(Interval interval) { |
428 |
return null; |
429 |
} |
430 |
|
431 |
@Override
|
432 |
public void disableNotifications() { |
433 |
|
434 |
} |
435 |
|
436 |
@Override
|
437 |
public void enableNotifications() { |
438 |
|
439 |
} |
440 |
|
441 |
@Override
|
442 |
public void beginComplexNotification() { |
443 |
|
444 |
} |
445 |
|
446 |
@Override
|
447 |
public void endComplexNotification() { |
448 |
|
449 |
} |
450 |
|
451 |
@Override
|
452 |
public void addObserver(Observer obsrvr) { |
453 |
|
454 |
} |
455 |
|
456 |
@Override
|
457 |
public void deleteObserver(Observer obsrvr) { |
458 |
|
459 |
} |
460 |
|
461 |
@Override
|
462 |
public void deleteObservers() { |
463 |
|
464 |
} |
465 |
|
466 |
@Override
|
467 |
public void saveToState(PersistentState ps) throws PersistenceException { |
468 |
|
469 |
} |
470 |
|
471 |
@Override
|
472 |
public void loadFromState(PersistentState ps) throws PersistenceException { |
473 |
|
474 |
} |
475 |
|
476 |
@Override
|
477 |
public Object getMetadataID() throws MetadataException { |
478 |
return null; |
479 |
} |
480 |
|
481 |
@Override
|
482 |
public String getMetadataName() throws MetadataException { |
483 |
return null; |
484 |
} |
485 |
|
486 |
@Override
|
487 |
public Set getMetadataChildren() throws MetadataException { |
488 |
return null; |
489 |
} |
490 |
|
491 |
@Override
|
492 |
public DynClass getDynClass() {
|
493 |
return null; |
494 |
} |
495 |
|
496 |
@Override
|
497 |
public void implement(DynClass dc) { |
498 |
|
499 |
} |
500 |
|
501 |
@Override
|
502 |
public void delegate(DynObject d) { |
503 |
|
504 |
} |
505 |
|
506 |
@Override
|
507 |
public Object getDynValue(String string) throws DynFieldNotFoundException { |
508 |
return null; |
509 |
} |
510 |
|
511 |
@Override
|
512 |
public void setDynValue(String string, Object o) throws DynFieldNotFoundException { |
513 |
|
514 |
} |
515 |
|
516 |
@Override
|
517 |
public boolean hasDynValue(String string) { |
518 |
return false; |
519 |
} |
520 |
|
521 |
@Override
|
522 |
public Object invokeDynMethod(String string, Object[] os) throws DynMethodException { |
523 |
return null; |
524 |
} |
525 |
|
526 |
@Override
|
527 |
public Object invokeDynMethod(int i, Object[] os) throws DynMethodException { |
528 |
return null; |
529 |
} |
530 |
|
531 |
@Override
|
532 |
public void clear() { |
533 |
|
534 |
} |
535 |
|
536 |
@Override
|
537 |
public void dispose() { |
538 |
|
539 |
} |
540 |
|
541 |
@Override
|
542 |
public void undo() throws UndoException { |
543 |
|
544 |
} |
545 |
|
546 |
@Override
|
547 |
public void undo(int i) throws UndoException { |
548 |
|
549 |
} |
550 |
|
551 |
@Override
|
552 |
public void redo() throws RedoException { |
553 |
|
554 |
} |
555 |
|
556 |
@Override
|
557 |
public void redo(int i) throws RedoException { |
558 |
|
559 |
} |
560 |
|
561 |
@Override
|
562 |
public List getUndoInfos() { |
563 |
return null; |
564 |
} |
565 |
|
566 |
@Override
|
567 |
public List getRedoInfos() { |
568 |
return null; |
569 |
} |
570 |
|
571 |
@Override
|
572 |
public boolean canUndo() { |
573 |
return false; |
574 |
} |
575 |
|
576 |
@Override
|
577 |
public boolean canRedo() { |
578 |
return false; |
579 |
} |
580 |
|
581 |
@Override
|
582 |
public List<Feature> getFeatures() { |
583 |
return null; |
584 |
} |
585 |
|
586 |
@Override
|
587 |
public void createCache(String name, DynObject parameters) throws DataException { |
588 |
|
589 |
} |
590 |
|
591 |
@Override
|
592 |
public FeatureCache getCache() {
|
593 |
return null; |
594 |
} |
595 |
|
596 |
@Override
|
597 |
public void useCache(String providerName, DynObject parameters) throws DataException { |
598 |
throw new UnsupportedOperationException(); |
599 |
} |
600 |
|
601 |
@Override
|
602 |
public DataStoreProviderFactory getProviderFactory() {
|
603 |
return null; |
604 |
} |
605 |
|
606 |
@Override
|
607 |
public boolean isBroken() { |
608 |
return false; |
609 |
} |
610 |
|
611 |
@Override
|
612 |
public Throwable getBreakingsCause() { |
613 |
return null; |
614 |
} |
615 |
|
616 |
@Override
|
617 |
public boolean hasDynMethod(String name) { |
618 |
return false; |
619 |
} |
620 |
|
621 |
@Override
|
622 |
public SpatialIndex wrapSpatialIndex(SpatialIndex index) {
|
623 |
return null; |
624 |
} |
625 |
|
626 |
@Override
|
627 |
public ExpressionBuilder createExpressionBuilder() {
|
628 |
return null; |
629 |
} |
630 |
|
631 |
@Override
|
632 |
public ExpressionBuilder createExpression() {
|
633 |
return createExpressionBuilder();
|
634 |
} |
635 |
|
636 |
@Override
|
637 |
public FeatureSet getFeatureSet(String filter) throws DataException { |
638 |
return null; |
639 |
} |
640 |
|
641 |
@Override
|
642 |
public FeatureSet getFeatureSet(String filter, String sortBy) throws DataException { |
643 |
return null; |
644 |
} |
645 |
|
646 |
@Override
|
647 |
public FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException { |
648 |
return null; |
649 |
} |
650 |
|
651 |
@Override
|
652 |
public List<Feature> getFeatures(FeatureQuery query) { |
653 |
return null; |
654 |
} |
655 |
|
656 |
@Override
|
657 |
public List<Feature> getFeatures(String filter) { |
658 |
return null; |
659 |
} |
660 |
|
661 |
@Override
|
662 |
public List<Feature> getFeatures(String filter, String sortBy) { |
663 |
return null; |
664 |
} |
665 |
|
666 |
@Override
|
667 |
public List<Feature> getFeatures(String filter, String sortBy, boolean asc) { |
668 |
return null; |
669 |
} |
670 |
|
671 |
@Override
|
672 |
public Feature findFirst(String filter) throws DataException { |
673 |
return null; |
674 |
} |
675 |
|
676 |
@Override
|
677 |
public Feature findFirst(String filter, String sortBy) throws DataException { |
678 |
return null; |
679 |
} |
680 |
|
681 |
@Override
|
682 |
public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException { |
683 |
return null; |
684 |
} |
685 |
|
686 |
@Override
|
687 |
public FeatureReference getFeatureReference(String code) { |
688 |
return null; |
689 |
} |
690 |
|
691 |
@Override
|
692 |
public FeatureSet getFeatureSet(Expression filter) throws DataException { |
693 |
return null; |
694 |
} |
695 |
|
696 |
@Override
|
697 |
public FeatureSet getFeatureSet(Expression filter, String sortBy) throws DataException { |
698 |
return null; |
699 |
} |
700 |
|
701 |
@Override
|
702 |
public FeatureSet getFeatureSet(Expression filter, String sortBy, boolean asc) throws DataException { |
703 |
return null; |
704 |
} |
705 |
|
706 |
@Override
|
707 |
public List<Feature> getFeatures(Expression filter) { |
708 |
return null; |
709 |
} |
710 |
|
711 |
@Override
|
712 |
public List<Feature> getFeatures(Expression filter, String sortBy) { |
713 |
return null; |
714 |
} |
715 |
|
716 |
@Override
|
717 |
public List<Feature> getFeatures(Expression filter, String sortBy, boolean asc) { |
718 |
return null; |
719 |
} |
720 |
|
721 |
@Override
|
722 |
public Feature findFirst(Expression filter) throws DataException { |
723 |
return null; |
724 |
} |
725 |
|
726 |
@Override
|
727 |
public Feature findFirst(Expression filter, String sortBy) throws DataException { |
728 |
return null; |
729 |
} |
730 |
|
731 |
@Override
|
732 |
public Feature findFirst(Expression filter, String sortBy, boolean asc) throws DataException { |
733 |
return null; |
734 |
} |
735 |
|
736 |
@Override
|
737 |
public Feature first() throws DataException { |
738 |
return null; |
739 |
} |
740 |
|
741 |
@Override
|
742 |
public long getPendingChangesCount() { |
743 |
return 0; |
744 |
} |
745 |
|
746 |
@Override
|
747 |
public ResourcesStorage getResourcesStorage() {
|
748 |
return new EmptyResourcesStorage(); |
749 |
} |
750 |
|
751 |
@Override
|
752 |
public StoresRepository getStoresRepository() {
|
753 |
return null; |
754 |
} |
755 |
|
756 |
@Override
|
757 |
public UnmodifiableBasicMap<String, DataStore> getChildren() { |
758 |
return UnmodifiableBasicMap.EMPTY_UNMODIFIABLEBASICMAP;
|
759 |
} |
760 |
|
761 |
@Override
|
762 |
public Feature findFirst(FeatureQuery query) throws DataException { |
763 |
return null; |
764 |
} |
765 |
|
766 |
@Override
|
767 |
public Feature getSampleFeature() {
|
768 |
return null; |
769 |
} |
770 |
} |