[osmosis-dev] Get underlying timestamp string
Rafael Troilo
rtroilo at gmail.com
Tue Nov 23 09:37:30 GMT 2010
Hello,
At the moment I use:
XmlTimestampFormat xmlTimestampFormat = new XmlTimestampFormat();
TimestampContainer tc = entity.getTimestampContainer();
String timestamp = tc.getFormattedTimestamp(xmlTimestampFormat);
to get the timestamp string out of the xml file without parsing. (be
sure enableDateParsing is not disabled)
But this leads me to a dependency to the osmosis-xml plugin, what I
don't really want.
So, it would be very nice, if we could supply a null value to
UnparsedTimestampContainer.getFormattedTimestamp(..) to get the
underlying timestampString without parsing.
Here my suggestion:
public String getFormattedTimestamp(TimestampFormat timestampFormat) {
if (timestampString != null &&
(timestampFormat == null ||
managedTimestampFormat.isEquivalent(timestampFormat))) {
return timestampString;
}
...
}
Thanks in advance,
Ciao,
Rafael
More information about the osmosis-dev
mailing list