public XMLCalendar(String value, short datatype) { value = XMLTypeUtil.normalize(value, true); if (value.length() == 0) { throw new InvalidDatatypeValueException("Incomplete value"); } if (datatype < 0 || datatype > GMONTH) { throw new IllegalArgumentException("Illegal datatype value " + datatype); } if (datatype == GMONTH && FIX_GMONTH_PARSE) { if (value.length() < 6 || value.charAt(4) != '-' || value.charAt(5) != '-') { StringBuilder v = new StringBuilder(value); v.insert(4, "--"); value = v.toString(); } } this.date = null; this.dataType = datatype; this.xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(value); }
public XMLDuration(String value) { duration = XMLCalendar.datatypeFactory.newDuration(XMLTypeUtil.normalize(value, true)); }
protected String replaceWhiteSpace(String value) { return XMLTypeUtil.normalize(value, false); }
protected String collapseWhiteSpace(String value) { return XMLTypeUtil.normalize(value, true); }