@Override public void addElement(EName element, String value, Attributes attributes) { // Ignore empty root element if (! rootTag.equals(element)) { super.addElement(element, value, attributes); } }
void add(EName property, String value, String language, @Nullable EName encodingScheme) { // Ignore empty rootTag element if (LANGUAGE_UNDEFINED.equals(language) && !property.equals(rootTag)) { if (encodingScheme == null) { addElement(property, value); } else { addTypedElement(property, value, encodingScheme); } } else { // Language defined if (encodingScheme == null) { addLocalizedElement(property, value, language); } else { addTypedLocalizedElement(property, value, language, encodingScheme); } } }
if (XSI_TYPE_ATTR.equals(attrEName)) {
/** * Tries to decode the given value as a W3C-DTF encoded date. If decoding fails, null is returned. * * @return the date or null if decoding fails */ public static Date decodeDate(DublinCoreValue value) { if (!value.hasEncodingScheme() || value.getEncodingScheme().get().equals(DublinCore.ENC_SCHEME_W3CDTF)) { try { return parseW3CDTF(value.getValue()); } catch (IllegalArgumentException ignore) { } } // Try unixtime in milliseconds (backwards-compatibility with older mediapackages) try { long timestamp = Long.parseLong(value.getValue()); Date decoded = new java.util.Date(timestamp); return decoded; } catch (NumberFormatException nfe) { } return null; }
/** * Decode a string encoded in the ISO8601 encoding scheme. * * @param value * the Dublin Core value * @return the duration in milliseconds or null, if the value cannot be parsed or is in a different encoding scheme */ public static Long decodeDuration(DublinCoreValue value) { if (!value.hasEncodingScheme() || value.getEncodingScheme().get().equals(DublinCore.ENC_SCHEME_ISO8601)) { return decodeDuration(value.getValue()); } return null; }
if ((mergeEntry.getEName()).equals(intoCatalog.getRootTag())) continue;