Revision f1a25720
Added by Katja Luther over 6 years ago
- ID f1a25720755daa96e8838a617a660dfced7b9f31
- Parent 23e50194
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.strategy.parser; |
11 | 11 |
|
12 |
import java.time.Year; |
|
13 |
import java.time.temporal.Temporal; |
|
12 | 14 |
import java.util.HashSet; |
13 | 15 |
import java.util.Set; |
14 | 16 |
import java.util.regex.Matcher; |
... | ... | |
16 | 18 |
|
17 | 19 |
import org.apache.commons.lang.StringUtils; |
18 | 20 |
import org.apache.log4j.Logger; |
19 |
import org.joda.time.DateTimeFieldType; |
|
20 |
import org.joda.time.Partial; |
|
21 | 21 |
|
22 | 22 |
import eu.etaxonomy.cdm.common.CdmUtils; |
23 | 23 |
import eu.etaxonomy.cdm.common.UTF8; |
... | ... | |
577 | 577 |
* @return |
578 | 578 |
* @throws StringNotParsableException |
579 | 579 |
*/ |
580 |
private static Partial parseSingleDate(String singleDateString)
|
|
580 |
private static Temporal parseSingleDate(String singleDateString)
|
|
581 | 581 |
throws StringNotParsableException{ |
582 |
Partial dt = new Partial();
|
|
582 |
Temporal dt = null;
|
|
583 | 583 |
if (CdmUtils.isNumeric(singleDateString)){ |
584 | 584 |
try { |
585 | 585 |
Integer year = Integer.valueOf(singleDateString.trim()); |
586 | 586 |
if (year > 1750 && year < 2050){ |
587 |
dt = dt.with(DateTimeFieldType.year(), year);
|
|
587 |
dt = Year.of(year);
|
|
588 | 588 |
}else{ |
589 | 589 |
dt = null; |
590 | 590 |
} |
Also available in: Unified diff
first implementation for change from joda time to java8 time