svn-gvsig-desktop / branches / org.gvsig.desktop-cvsgis1 / 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 / DummyFeatureAttributeDescriptor.java @ 45419
History | View | Annotate | Download (13.5 KB)
1 |
|
---|---|
2 |
package org.gvsig.fmap.dal.feature; |
3 |
|
4 |
import java.math.BigDecimal; |
5 |
import java.math.MathContext; |
6 |
import java.text.DateFormat; |
7 |
import java.util.List; |
8 |
import java.util.Locale; |
9 |
import java.util.Objects; |
10 |
import java.util.function.Supplier; |
11 |
import javax.json.JsonObject; |
12 |
import org.cresques.cts.IProjection; |
13 |
import org.gvsig.expressionevaluator.Expression; |
14 |
import org.gvsig.fmap.geom.type.GeometryType; |
15 |
import org.gvsig.json.JsonObjectBuilder; |
16 |
import org.gvsig.timesupport.Interval; |
17 |
import org.gvsig.tools.dataTypes.Coercion; |
18 |
import org.gvsig.tools.dataTypes.CoercionContext; |
19 |
import org.gvsig.tools.dataTypes.CoercionException; |
20 |
import org.gvsig.tools.dataTypes.DataType; |
21 |
import org.gvsig.tools.dynobject.DynField; |
22 |
import org.gvsig.tools.dynobject.DynMethod; |
23 |
import org.gvsig.tools.dynobject.DynObject; |
24 |
import org.gvsig.tools.dynobject.DynObjectValueItem; |
25 |
import org.gvsig.tools.dynobject.DynStruct; |
26 |
import org.gvsig.tools.dynobject.Tags; |
27 |
import org.gvsig.tools.dynobject.exception.DynFieldIsNotAContainerException; |
28 |
import org.gvsig.tools.dynobject.exception.DynFieldValidateException; |
29 |
import org.gvsig.tools.evaluator.Evaluator; |
30 |
import org.gvsig.tools.persistence.PersistentState; |
31 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
32 |
|
33 |
/**
|
34 |
* This class is intended to be used in test.
|
35 |
* Use it directly or extend it and overwrite the methods you need.
|
36 |
* This class is maintained as part of the DAL API.
|
37 |
*/
|
38 |
public class DummyFeatureAttributeDescriptor implements FeatureAttributeDescriptor { |
39 |
|
40 |
@Override
|
41 |
public Object clone() throws CloneNotSupportedException { |
42 |
return super.clone(); |
43 |
} |
44 |
|
45 |
@Override
|
46 |
public FeatureAttributeDescriptor getCopy() {
|
47 |
return null; |
48 |
} |
49 |
|
50 |
@Override
|
51 |
public String getDataTypeName() { |
52 |
return null; |
53 |
} |
54 |
|
55 |
@Override
|
56 |
public int getSize() { |
57 |
return 0; |
58 |
} |
59 |
|
60 |
@Override
|
61 |
public int getPrecision() { |
62 |
return 0; |
63 |
} |
64 |
|
65 |
@Override
|
66 |
public int getScale() { |
67 |
return 0; |
68 |
} |
69 |
|
70 |
@Override
|
71 |
public Coercion getCoercion() {
|
72 |
return null; |
73 |
} |
74 |
|
75 |
@Override
|
76 |
public CoercionContext getCoercionContext() {
|
77 |
return null; |
78 |
} |
79 |
|
80 |
@Override
|
81 |
public MathContext getMathContext() { |
82 |
return MathContext.UNLIMITED; |
83 |
} |
84 |
|
85 |
@Override
|
86 |
public Class getObjectClass() { |
87 |
return null; |
88 |
} |
89 |
|
90 |
@Override
|
91 |
public int getMinimumOccurrences() { |
92 |
return 0; |
93 |
} |
94 |
|
95 |
@Override
|
96 |
public int getMaximumOccurrences() { |
97 |
return 0; |
98 |
} |
99 |
|
100 |
@Override
|
101 |
public boolean isPrimaryKey() { |
102 |
return false; |
103 |
} |
104 |
|
105 |
@Override
|
106 |
public boolean allowNull() { |
107 |
return false; |
108 |
} |
109 |
|
110 |
@Override
|
111 |
public Evaluator getEvaluator() {
|
112 |
return null; |
113 |
} |
114 |
|
115 |
@Override
|
116 |
public IProjection getSRS() {
|
117 |
return null; |
118 |
} |
119 |
|
120 |
@Override
|
121 |
public int getGeometryType() { |
122 |
return 0; |
123 |
} |
124 |
|
125 |
@Override
|
126 |
public int getGeometrySubType() { |
127 |
return 0; |
128 |
} |
129 |
|
130 |
@Override
|
131 |
public GeometryType getGeomType() {
|
132 |
return null; |
133 |
} |
134 |
|
135 |
@Override
|
136 |
public DateFormat getDateFormat() { |
137 |
return null; |
138 |
} |
139 |
|
140 |
@Override
|
141 |
public int getIndex() { |
142 |
return 0; |
143 |
} |
144 |
|
145 |
@Override
|
146 |
public String getAdditionalInfo(String infoName) { |
147 |
return null; |
148 |
} |
149 |
|
150 |
@Override
|
151 |
public boolean isAutomatic() { |
152 |
return false; |
153 |
} |
154 |
|
155 |
@Override
|
156 |
public boolean isTime() { |
157 |
return false; |
158 |
} |
159 |
|
160 |
@Override
|
161 |
public boolean isIndexed() { |
162 |
return false; |
163 |
} |
164 |
|
165 |
@Override
|
166 |
public boolean allowIndexDuplicateds() { |
167 |
return false; |
168 |
} |
169 |
|
170 |
@Override
|
171 |
public boolean isIndexAscending() { |
172 |
return false; |
173 |
} |
174 |
|
175 |
@Override
|
176 |
public FeatureAttributeGetter getFeatureAttributeGetter() {
|
177 |
return null; |
178 |
} |
179 |
|
180 |
@Override
|
181 |
public void setFeatureAttributeGetter(FeatureAttributeGetter featureAttributeGetter) { |
182 |
|
183 |
} |
184 |
|
185 |
@Override
|
186 |
public FeatureAttributeEmulator getFeatureAttributeEmulator() {
|
187 |
return null; |
188 |
} |
189 |
|
190 |
@Override
|
191 |
public String getName() { |
192 |
return null; |
193 |
} |
194 |
|
195 |
@Override
|
196 |
public int getType() { |
197 |
return 0; |
198 |
} |
199 |
|
200 |
@Override
|
201 |
public DataType getDataType() {
|
202 |
return null; |
203 |
} |
204 |
|
205 |
@Override
|
206 |
public String getSubtype() { |
207 |
return null; |
208 |
} |
209 |
|
210 |
@Override
|
211 |
public String getDescription() { |
212 |
return null; |
213 |
} |
214 |
|
215 |
@Override
|
216 |
public Object getDefaultValue() { |
217 |
return null; |
218 |
} |
219 |
|
220 |
@Override
|
221 |
public String getGroup() { |
222 |
return null; |
223 |
} |
224 |
|
225 |
@Override
|
226 |
public int getOder() { |
227 |
return 0; |
228 |
} |
229 |
|
230 |
@Override
|
231 |
public boolean isMandatory() { |
232 |
return false; |
233 |
} |
234 |
|
235 |
@Override
|
236 |
public boolean isPersistent() { |
237 |
return false; |
238 |
} |
239 |
|
240 |
@Override
|
241 |
public boolean isHidden() { |
242 |
return false; |
243 |
} |
244 |
|
245 |
@Override
|
246 |
public boolean isReadOnly() { |
247 |
return false; |
248 |
} |
249 |
|
250 |
@Override
|
251 |
public boolean isContainer() { |
252 |
return false; |
253 |
} |
254 |
|
255 |
@Override
|
256 |
public DynObjectValueItem[] getAvailableValues() { |
257 |
return null; |
258 |
} |
259 |
|
260 |
@Override
|
261 |
public boolean hasConstantAvailableValues() { |
262 |
return false; |
263 |
} |
264 |
|
265 |
@Override
|
266 |
public Object getMinValue() { |
267 |
return null; |
268 |
} |
269 |
|
270 |
@Override
|
271 |
public Object getMaxValue() { |
272 |
return null; |
273 |
} |
274 |
|
275 |
@Override
|
276 |
public Class getClassOfValue() { |
277 |
return null; |
278 |
} |
279 |
|
280 |
@Override
|
281 |
public Class getClassOfItems() { |
282 |
return null; |
283 |
} |
284 |
|
285 |
@Override
|
286 |
public DynField setDescription(String string) { |
287 |
return null; |
288 |
} |
289 |
|
290 |
@Override
|
291 |
public DynField setType(int i) { |
292 |
return null; |
293 |
} |
294 |
|
295 |
@Override
|
296 |
public DynField setType(DataType dt) {
|
297 |
return null; |
298 |
} |
299 |
|
300 |
@Override
|
301 |
public DynField setSubtype(String string) { |
302 |
return null; |
303 |
} |
304 |
|
305 |
@Override
|
306 |
public DynField setDefaultFieldValue(Object o) { |
307 |
return null; |
308 |
} |
309 |
|
310 |
@Override
|
311 |
public DynField setGroup(String string) { |
312 |
return null; |
313 |
} |
314 |
|
315 |
@Override
|
316 |
public DynField setOrder(int i) { |
317 |
return null; |
318 |
} |
319 |
|
320 |
@Override
|
321 |
public DynField setMandatory(boolean bln) { |
322 |
return null; |
323 |
} |
324 |
|
325 |
@Override
|
326 |
public DynField setHidden(boolean bln) { |
327 |
return null; |
328 |
} |
329 |
|
330 |
@Override
|
331 |
public DynField setPersistent(boolean bln) { |
332 |
return null; |
333 |
} |
334 |
|
335 |
@Override
|
336 |
public DynField setAvailableValues(DynObjectValueItem[] dovis) { |
337 |
return null; |
338 |
} |
339 |
|
340 |
@Override
|
341 |
public DynField setAvailableValues(List list) { |
342 |
return null; |
343 |
} |
344 |
|
345 |
@Override
|
346 |
public DynField setMinValue(Object o) { |
347 |
return null; |
348 |
} |
349 |
|
350 |
@Override
|
351 |
public DynField setMaxValue(Object o) { |
352 |
return null; |
353 |
} |
354 |
|
355 |
@Override
|
356 |
public DynField setClassOfValue(Class type) throws DynFieldIsNotAContainerException { |
357 |
return null; |
358 |
} |
359 |
|
360 |
@Override
|
361 |
public DynField setClassOfItems(Class type) throws DynFieldIsNotAContainerException { |
362 |
return null; |
363 |
} |
364 |
|
365 |
@Override
|
366 |
public DynField setReadOnly(boolean bln) { |
367 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
368 |
} |
369 |
|
370 |
@Override
|
371 |
public DynField getElementsType() {
|
372 |
return null; |
373 |
} |
374 |
|
375 |
@Override
|
376 |
public DynField setElementsType(int i) throws DynFieldIsNotAContainerException { |
377 |
return null; |
378 |
} |
379 |
|
380 |
@Override
|
381 |
public DynField setElementsType(DynStruct ds) throws DynFieldIsNotAContainerException { |
382 |
return null; |
383 |
} |
384 |
|
385 |
@Override
|
386 |
public void validate(Object o) throws DynFieldValidateException { |
387 |
|
388 |
} |
389 |
|
390 |
@Override
|
391 |
public Object coerce(Object o) throws CoercionException { |
392 |
return null; |
393 |
} |
394 |
|
395 |
@Override
|
396 |
public int getTheTypeOfAvailableValues() { |
397 |
return 0; |
398 |
} |
399 |
|
400 |
@Override
|
401 |
public DynField setDefaultDynValue(Object o) { |
402 |
return null; |
403 |
} |
404 |
|
405 |
@Override
|
406 |
public DynField setTheTypeOfAvailableValues(int i) { |
407 |
return null; |
408 |
} |
409 |
|
410 |
@Override
|
411 |
public boolean isComputed() { |
412 |
return false; |
413 |
} |
414 |
|
415 |
@Override
|
416 |
public FeatureStore getStore() {
|
417 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
418 |
} |
419 |
|
420 |
@Override
|
421 |
public FeatureType getFeatureType() {
|
422 |
return null; |
423 |
} |
424 |
|
425 |
@Override
|
426 |
public Interval getInterval() {
|
427 |
return null; |
428 |
} |
429 |
|
430 |
@Override
|
431 |
public String getDataProfileName() { |
432 |
return null; |
433 |
} |
434 |
|
435 |
@Override
|
436 |
public String[] getRequiredFieldNames() { |
437 |
return null; |
438 |
} |
439 |
|
440 |
@Override
|
441 |
public DynField setClassOfValue(DynStruct dynStrct) {
|
442 |
return this; |
443 |
} |
444 |
|
445 |
@Override
|
446 |
public DynField setClassOfValue(String theClassNameOfValue) { |
447 |
return this; |
448 |
} |
449 |
|
450 |
@Override
|
451 |
public String getClassNameOfValue() { |
452 |
return null; |
453 |
} |
454 |
|
455 |
@Override
|
456 |
public DynStruct getDynClassOfValue() {
|
457 |
return null; |
458 |
} |
459 |
|
460 |
@Override
|
461 |
public DynField setTypeOfItems(int type) { |
462 |
return this; |
463 |
} |
464 |
|
465 |
@Override
|
466 |
public int getTypeOfItems() { |
467 |
return 0; |
468 |
} |
469 |
|
470 |
@Override
|
471 |
public DynField setClassOfItems(DynStruct dynStrct) {
|
472 |
return this; |
473 |
} |
474 |
|
475 |
@Override
|
476 |
public DynField setClassOfItems(String theClassNameOfValue) { |
477 |
return this; |
478 |
} |
479 |
|
480 |
@Override
|
481 |
public String getClassNameOfItems() { |
482 |
return null; |
483 |
} |
484 |
|
485 |
@Override
|
486 |
public DynStruct getDynClassOfItems() {
|
487 |
return null; |
488 |
} |
489 |
|
490 |
@Override
|
491 |
public Tags getTags() {
|
492 |
return null; |
493 |
} |
494 |
|
495 |
@Override
|
496 |
public DynField setRelationType(int relationType) { |
497 |
return this; |
498 |
} |
499 |
|
500 |
@Override
|
501 |
public int getRelationType() { |
502 |
return 0; |
503 |
} |
504 |
|
505 |
@Override
|
506 |
public DynField setAvailableValues(DynMethod computeAvailableValues) {
|
507 |
return this; |
508 |
} |
509 |
|
510 |
@Override
|
511 |
public DynMethod getAvailableValuesMethod() {
|
512 |
return null; |
513 |
} |
514 |
|
515 |
@Override
|
516 |
public DynObjectValueItem[] getAvailableValues(DynObject self) { |
517 |
return null; |
518 |
} |
519 |
|
520 |
@Override
|
521 |
public boolean isAvailableValuesCalculated() { |
522 |
return false; |
523 |
} |
524 |
|
525 |
@Override
|
526 |
public DynField setCalculateMethod(DynMethod computeValue) {
|
527 |
return this; |
528 |
} |
529 |
|
530 |
@Override
|
531 |
public DynMethod getCalculateMethod() {
|
532 |
return null; |
533 |
} |
534 |
|
535 |
@Override
|
536 |
public boolean isCalculated() { |
537 |
return false; |
538 |
} |
539 |
|
540 |
@Override
|
541 |
public Object getCalculatedValue(DynObject self) { |
542 |
return null; |
543 |
} |
544 |
|
545 |
@Override
|
546 |
public void copyFrom(DynField other) { |
547 |
} |
548 |
|
549 |
@Override
|
550 |
public DynField setValidateElements(boolean validate) { |
551 |
return this; |
552 |
} |
553 |
|
554 |
@Override
|
555 |
public boolean getValidateElements() { |
556 |
return false; |
557 |
} |
558 |
|
559 |
@Override
|
560 |
public String getLabel() { |
561 |
return null; |
562 |
} |
563 |
|
564 |
@Override
|
565 |
public DynField setLabel(String label) { |
566 |
return this; |
567 |
} |
568 |
|
569 |
@Override
|
570 |
public void recentUsed() { |
571 |
} |
572 |
|
573 |
@Override
|
574 |
public boolean isForeingKey() { |
575 |
return false; |
576 |
} |
577 |
|
578 |
@Override
|
579 |
public ForeingKey getForeingKey() {
|
580 |
return null; |
581 |
} |
582 |
|
583 |
@Override
|
584 |
public String getShortLabel() { |
585 |
return null; |
586 |
} |
587 |
|
588 |
@Override
|
589 |
public DynField setShortLabel(String shortLabel) { |
590 |
return this; |
591 |
} |
592 |
|
593 |
@Override
|
594 |
public String getLocalizedShortLabel() { |
595 |
return this.getShortLabel(); |
596 |
} |
597 |
|
598 |
@Override
|
599 |
public String getLocalizedLabel() { |
600 |
return this.getLabel(); |
601 |
} |
602 |
|
603 |
@Override
|
604 |
public String getLabelOfValue(Object value) { |
605 |
return Objects.toString(value, ""); |
606 |
} |
607 |
|
608 |
@Override
|
609 |
public DataProfile getDataProfile() {
|
610 |
return null; |
611 |
} |
612 |
|
613 |
@Override
|
614 |
public boolean hasOnlyMetadataChanges(FeatureAttributeDescriptor other) { |
615 |
return false; |
616 |
} |
617 |
|
618 |
@Override
|
619 |
public boolean hasLabel() { |
620 |
return false; |
621 |
} |
622 |
|
623 |
@Override
|
624 |
public boolean hasShortLabel() { |
625 |
return false; |
626 |
} |
627 |
|
628 |
@Override
|
629 |
public boolean hasDescription() { |
630 |
return false; |
631 |
} |
632 |
|
633 |
@Override
|
634 |
public FeatureAttributeDescriptor getValue() {
|
635 |
return this; |
636 |
} |
637 |
|
638 |
@Override
|
639 |
public Object getDefaultValueCoerced() { |
640 |
return null; |
641 |
} |
642 |
|
643 |
@Override
|
644 |
public int getRoundMode() { |
645 |
return BigDecimal.ROUND_HALF_UP; |
646 |
} |
647 |
|
648 |
@Override
|
649 |
public Locale getLocale() { |
650 |
return Locale.ENGLISH; |
651 |
} |
652 |
|
653 |
@Override
|
654 |
public Object get(String name) { |
655 |
return null; |
656 |
} |
657 |
|
658 |
@Override
|
659 |
public void saveToState(PersistentState state) throws PersistenceException { |
660 |
|
661 |
} |
662 |
|
663 |
@Override
|
664 |
public void loadFromState(PersistentState state) throws PersistenceException { |
665 |
|
666 |
} |
667 |
|
668 |
@Override
|
669 |
public int getDisplaySize() { |
670 |
return 0; |
671 |
} |
672 |
|
673 |
@Override
|
674 |
public Expression getAvailableValuesExpression() { |
675 |
return null; |
676 |
} |
677 |
|
678 |
@Override
|
679 |
public FeatureAttributeDescriptor setAvailableValuesExpression(String expression) { |
680 |
return this; |
681 |
} |
682 |
|
683 |
@Override
|
684 |
public FeatureAttributeDescriptor setAvailableValuesExpression(Expression expression) { |
685 |
return this; |
686 |
} |
687 |
|
688 |
@Override
|
689 |
public boolean isAvoidCachingAvailableValues() { |
690 |
return false; |
691 |
} |
692 |
|
693 |
@Override
|
694 |
public JsonObject toJson() {
|
695 |
return null; |
696 |
} |
697 |
|
698 |
@Override
|
699 |
public JsonObjectBuilder toJsonBuilder() {
|
700 |
return null; |
701 |
} |
702 |
|
703 |
@Override
|
704 |
public boolean isInAvailableValues(Object valueToCheck) { |
705 |
return false; |
706 |
} |
707 |
|
708 |
@Override
|
709 |
public boolean hasAvailableValues() { |
710 |
return false; |
711 |
} |
712 |
|
713 |
@Override
|
714 |
public Supplier getDefaultValueSupplier() {
|
715 |
return null; |
716 |
} |
717 |
|
718 |
@Override
|
719 |
public DynField setDefaultValueSupplier(Supplier supplier) {
|
720 |
return this; |
721 |
} |
722 |
|
723 |
} |