Hi Rafael,<br><br><div class="gmail_quote">On Tue, Nov 23, 2010 at 8:37 PM, Rafael Troilo <span dir="ltr"><<a href="mailto:rtroilo@gmail.com">rtroilo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello,<br>
<br>
At the moment I use:<br>
<br>
XmlTimestampFormat xmlTimestampFormat = new XmlTimestampFormat();<br>
TimestampContainer tc = entity.getTimestampContainer();<br>
String timestamp = tc.getFormattedTimestamp(xmlTimestampFormat);<br>
<br>
to get the timestamp string out of the xml file without parsing. (be<br>
sure enableDateParsing is not disabled)<br>
But this leads me to a dependency to the osmosis-xml plugin, what I<br>
don't really want.<br></blockquote><div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
So, it would be very nice, if we could supply a null value to<br>
UnparsedTimestampContainer.getFormattedTimestamp(..) to get the<br>
underlying timestampString without parsing.<br>
<br>
Here my suggestion:<br>
<br>
public String getFormattedTimestamp(TimestampFormat timestampFormat) {<br>
    if (timestampString != null &&<br>
         (timestampFormat == null ||<br>
          managedTimestampFormat.isEquivalent(timestampFormat))) {<br>
      return timestampString;<br>
    }<br>
  ...<br>
}<br></blockquote><div><br>What is your reason for avoiding a dependency on osmosis-xml?  What you want is the date in XML timestamp format, so introducing a dependency on the Osmosis XML classes doesn't seem like such a big issue.  The reason I designed it that was was precisely to prevent anybody making assumptions about the internal date string format.  It's a fairly safe be to assume that the osmosis XML libs will always be available in the Osmosis distribution.<br>
<br>This way you're forced to say you want the string in XML format, and if the string is already in that format no conversion will be required.  If it happens to be in an alternate format or there is no string representation available then the conversion will be automatic.  At least that's what I think it's supposed to do, it's been a while since I wrote that bit ;-)<br>
<br>Brett<br><br></div></div>