private void getMetaDataDateInfo(Metadata metadata, DefaultMetadata defaultMetaData){ ArrayList<CitationDate> citationDateList= (ArrayList<CitationDate>) defaultMetaData.getDateInfo(); for(CitationDate c:citationDateList){ if(c.getDateType()!=null) { String date = DateUtils.formatDate(c.getDate()); metadata.add("DateInfo ",c.getDateType().name()+" "+date); } } }
/** * Returns the DateType that matches the given string, or returns a * new one if none match it. */ public static DateType valueOf(String code) { if (code == null) { return null; } synchronized (VALUES) { Iterator iter = VALUES.iterator(); while (iter.hasNext()) { DateType type = (DateType) iter.next(); if (code.equalsIgnoreCase(type.name())) { return type; } } return new DateType(code); } } }
/** * Adds a date in the given collection, making sure that there is no two dates of the same type. * If two dates are of the same type, retains the latest one if the type name starts with {@code "LATE_"} * or retains the earliest date otherwise. */ private static void addEarliest(final Collection<CitationDate> dates, final CitationDate cd, final DateType type) { for (final Iterator<CitationDate> it = dates.iterator(); it.hasNext();) { final CitationDate co = it.next(); if (type.equals(co.getDateType())) { final Date oldDate = co.getDate(); final Date newDate = cd.getDate(); if (type.name().startsWith("LATE_") ? oldDate.before(newDate) : oldDate.after(newDate)) { it.remove(); break; } return; } } dates.add(cd); }
/** * Adds a date in the given collection, making sure that there is no two dates of the same type. * If two dates are of the same type, retains the latest one if the type name starts with {@code "LATE_"} * or retains the earliest date otherwise. */ private static void addEarliest(final Collection<CitationDate> dates, final CitationDate cd, final DateType type) { for (final Iterator<CitationDate> it = dates.iterator(); it.hasNext();) { final CitationDate co = it.next(); if (type.equals(co.getDateType())) { final Date oldDate = co.getDate(); final Date newDate = cd.getDate(); if (type.name().startsWith("LATE_") ? oldDate.before(newDate) : oldDate.after(newDate)) { it.remove(); break; } return; } } dates.add(cd); }
if (d.getDateType()!=null) { String date = DateUtils.formatDate(d.getDate()); metadata.add("CitationDate ",d.getDateType().name()+"-->"+date); if (cd.getDateType()!=null) { String date = DateUtils.formatDate(cd.getDate()); metadata.add("ThesaurusNameDate ",cd.getDateType().name() +"-->" + date); if (cd.getDateType()!=null && cd.getDate()!=null) { String date = DateUtils.formatDate(cd.getDate()); metadata.add("GeographicIdentifierAuthorityDate ",cd.getDateType().name()+" "+date);
private void getMetaDataDateInfo(Metadata metadata, DefaultMetadata defaultMetaData){ ArrayList<CitationDate> citationDateList= (ArrayList<CitationDate>) defaultMetaData.getDateInfo(); for(CitationDate c:citationDateList){ if(c.getDateType()!=null) metadata.add("DateInfo ",c.getDateType().name()+" "+c.getDate()); } }
private void getMetaDataDateInfo(Metadata metadata, DefaultMetadata defaultMetaData){ ArrayList<CitationDate> citationDateList= (ArrayList<CitationDate>) defaultMetaData.getDateInfo(); for(CitationDate c:citationDateList){ if(c.getDateType()!=null) metadata.add("DateInfo ",c.getDateType().name()+" "+c.getDate()); } }
for (CitationDate d:dateArrayList){ if(d.getDateType()!=null) metadata.add("CitationDate ",d.getDateType().name()+"-->"+d.getDate()); for(CitationDate cd:citationDates) { if(cd.getDateType()!=null) metadata.add("ThesaurusNameDate ",cd.getDateType().name() +"-->" + cd.getDate()); metadata.add("GeographicIdentifierAuthorityDate ",cd.getDateType().name()+" "+cd.getDate().toString());
for (CitationDate d:dateArrayList){ if(d.getDateType()!=null) metadata.add("CitationDate ",d.getDateType().name()+"-->"+d.getDate()); for(CitationDate cd:citationDates) { if(cd.getDateType()!=null) metadata.add("ThesaurusNameDate ",cd.getDateType().name() +"-->" + cd.getDate()); metadata.add("GeographicIdentifierAuthorityDate ",cd.getDateType().name()+" "+cd.getDate().toString());