Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 package org.apache.xmlrpc.parser;
00020
00021 import java.text.ParseException;
00022
00023 import org.apache.ws.commons.util.XsDateTimeFormat;
00024 import org.xml.sax.SAXException;
00025 import org.xml.sax.SAXParseException;
00026
00027
00030 public class CalendarParser extends AtomicParser {
00031 private static final XsDateTimeFormat format = new XsDateTimeFormat();
00032
00033 protected void setResult(String pResult) throws SAXException {
00034 try {
00035 super.setResult(format.parseObject(pResult.trim()));
00036 } catch (ParseException e) {
00037 int offset = e.getErrorOffset();
00038 final String msg;
00039 if (offset == -1) {
00040 msg = "Failed to parse dateTime value: " + pResult;
00041 } else {
00042 msg = "Failed to parse dateTime value " + pResult
00043 + " at position " + e.getErrorOffset();
00044 }
00045 throw new SAXParseException(msg, getDocumentLocator(), e);
00046 }
00047 }
00048 }