@Test public void testParseDateTaken() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); NsrMultiMediaTransformer mediaTransformer = new NsrMultiMediaTransformer(etlStatistics); Object returned = ReflectionUtil.call(mediaTransformer, "parseDateTaken", new Class[] {String.class}, new Object[] {"10 February 2013"}); OffsetDateTime date = (OffsetDateTime) returned; String expectedDateString = "2013-02-10T00:00Z"; assertNotNull(date); assertEquals(expectedDateString, date.toString()); }
private OffsetDateTime parseDateTaken(String date) { ESDateInput input = new ESDateInput(date); OffsetDateTime odt = input.parseAsLocalDate(formatter0); if (odt == null) { odt = input.parseAsLocalDate(formatter1); } if (odt == null) { if (!suppressErrors) { warn("Invalid input for <date_taken>: " + date); } } return odt; }
NsrMultiMediaTransformer extends AbstractJSONTransformer<MultiMediaObject> { private OffsetDateTime parseDateTaken(String date) { ESDateInput input = new ESDateInput(date); OffsetDateTime odt = input.parseAsLocalDate(formatter0); if (odt == null) { odt = input.parseAsLocalDate(formatter1); } if (odt == null) { if (!suppressErrors) { warn("Invalid input for <date_taken>: " + date); } } return odt; } }
NsrMultiMediaTransformer extends AbstractJSONTransformer<MultiMediaObject> { private OffsetDateTime parseDateTaken(String date) { ESDateInput input = new ESDateInput(date); OffsetDateTime odt = input.parseAsLocalDate(formatter0); if (odt == null) { odt = input.parseAsLocalDate(formatter1); } if (odt == null) { if (!suppressErrors) { warn("Invalid input for <date_taken>: " + date); } } return odt; } NsrMultiMediaTransformer(ETLStatistics stats); }
NsrMultiMediaTransformer extends AbstractJSONTransformer<MultiMediaObject> { private OffsetDateTime parseDateTaken(String date) { ESDateInput input = new ESDateInput(date); OffsetDateTime odt = input.parseAsLocalDate(formatter0); if (odt == null) { odt = input.parseAsLocalDate(formatter1); } if (odt == null) { if (!suppressErrors) { warn("Invalid input for <date_taken>: " + date); } } return odt; } NsrMultiMediaTransformer(ETLStatistics stats); void setTaxon(Taxon taxon); }
NsrMultiMediaTransformer extends AbstractJSONTransformer<MultiMediaObject> { private OffsetDateTime parseDateTaken(String date) { ESDateInput input = new ESDateInput(date); OffsetDateTime odt = input.parseAsLocalDate(formatter0); if (odt == null) { odt = input.parseAsLocalDate(formatter1); } if (odt == null) { if (!suppressErrors) { warn("Invalid input for <date_taken>: " + date); } } return odt; } NsrMultiMediaTransformer(ETLStatistics stats); void setTaxon(Taxon taxon);  }