Revision 44136 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.impl/src/main/java/org/gvsig/timesupport/impl/coercion/CoerceToDate.java
CoerceToDate.java | ||
---|---|---|
13 | 13 |
*/ |
14 | 14 |
public class CoerceToDate implements CoercionWithLocale{ |
15 | 15 |
|
16 |
private final Coercion previous; |
|
17 |
|
|
18 |
public CoerceToDate(Coercion previous) { |
|
19 |
this.previous = previous; |
|
16 |
|
|
17 |
public CoerceToDate() { |
|
20 | 18 |
} |
21 | 19 |
|
22 | 20 |
@Override |
... | ... | |
32 | 30 |
if( o instanceof RelativeInterval ) { |
33 | 31 |
return ((RelativeInterval) o).getStart().toDate(); |
34 | 32 |
} |
35 |
if( this.previous instanceof CoercionWithLocale ) { |
|
36 |
return ((CoercionWithLocale)this.previous).coerce(o, locale); |
|
37 |
} |
|
38 |
return this.previous.coerce(o); |
|
33 |
throw new CoercionException("Can't convert object to date"); |
|
39 | 34 |
} |
40 | 35 |
|
41 | 36 |
} |
Also available in: Unified diff