private static Node findNode(XPathExpression expr, Object context) throws ParserException { try { return (Node) expr.evaluate(context, XPathConstants.NODE); } catch (XPathException e) { throw new ParserException("Unable to find node", -1, e); } }
public void setValue(InputStream is) { try { this.value = CalendarUtils.parseCalendar(is); } catch (ParserException e) { throw new ModelValidationException("invalid calendar: " + e.getMessage()); } catch (IOException ioe) { throw new ModelValidationException("error parsing calendar: " + ioe.getMessage()); } }
/** * Test the accuracy of parser exception line number. * * @throws IOException */ public void testParserException() throws IOException { try { Calendars.load(resource); fail("Should throw ParserException: [" + resource + "]"); } catch (ParserException pe) { LOG.info(pe.getMessage()); assertEquals(expectedErrorLineNo, pe.getLineNo()); } }
public void setValue(InputStream is) { try { this.value = CalendarUtils.parseCalendar(is); } catch (ParserException e) { throw new ModelValidationException("invalid calendar: " + e.getMessage()); } catch (IOException ioe) { throw new ModelValidationException("error parsing calendar: " + ioe.getMessage()); } }
private static NodeList findNodes(XPathExpression expr, Object context) throws ParserException { try { return (NodeList) expr.evaluate(context, XPathConstants.NODESET); } catch (XPathException e) { throw new ParserException("Unable to find nodes", -1, e); } }
/** * Test loading of calendars. * * @throws IOException */ public void testLoadParserException() throws IOException { try { Calendars.load(resource); fail("Should throw ParserException"); } catch (ParserException pe) { LOG.info("Caught exception: " + pe.getMessage()); } }
private static Node findNode(XPathExpression expr, Object context) throws ParserException { try { return (Node) expr.evaluate(context, XPathConstants.NODE); } catch (XPathException e) { throw new ParserException("Unable to find node", -1, e); } }
throw new IcalMalformedException(pe.getMessage()); } catch (final Throwable t) { throw new CalFacadeException(t);
private static Node findNode(XPathExpression expr, Object context) throws ParserException { try { return (Node) expr.evaluate(context, XPathConstants.NODE); } catch (XPathException e) { throw new ParserException("Unable to find node", -1, e); } }
throw new IcalMalformedException(pe.getMessage()); } catch (final Throwable t) { throw new CalFacadeException(t);
private static NodeList findNodes(XPathExpression expr, Object context) throws ParserException { try { return (NodeList) expr.evaluate(context, XPathConstants.NODESET); } catch (XPathException e) { throw new ParserException("Unable to find nodes", -1, e); } }
public void testRelaxedParsing() throws IOException, ParserException { try { Calendars.load(getClass().getResource("/samples/invalid/groupwise.ics")); fail("Should throw URISyntaxException"); } catch (ParserException pe) { LOG.info("Caught exception: " + pe.getMessage()); } CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING, true); Calendar calendar = Calendars.load(getClass().getResource("/samples/invalid/groupwise.ics")); Attendee attendee = (Attendee) calendar.getComponent(Component.VEVENT).getProperty(Property.ATTENDEE); assertNotNull(attendee.getCalAddress()); } }
private static Node findNode(XPathExpression expr, Object context) throws ParserException { try { return (Node) expr.evaluate(context, XPathConstants.NODE); } catch (XPathException e) { throw new ParserException("Unable to find node", -1, e); } }
throw new CosmoDavException(e); } catch (ParserException e) { throw new InvalidCalendarDataException("Failed to parse calendar object: " + e.getMessage()); } catch (ValidationException e) { throw new InvalidCalendarDataException("Invalid calendar object: " + e.getMessage());
private static NodeList findNodes(XPathExpression expr, Object context) throws ParserException { try { return (NodeList) expr.evaluate(context, XPathConstants.NODESET); } catch (XPathException e) { throw new ParserException("Unable to find nodes", -1, e); } }
throw new CosmoDavException(e); } catch (ParserException e) { throw new InvalidCalendarDataException("Failed to parse calendar object: " + e.getMessage()); } catch (ValidationException e) { throw new InvalidCalendarDataException("Invalid calendar object: " + e.getMessage());
private static NodeList findNodes(XPathExpression expr, Object context) throws ParserException { try { return (NodeList) expr.evaluate(context, XPathConstants.NODESET); } catch (XPathException e) { throw new ParserException("Unable to find nodes", -1, e); } }
error(pe); throw new IcalMalformedException(pe.getMessage()); } catch (Throwable t) { throw new CalFacadeException(t);
private static Node findNode(XPathExpression expr, Object context) throws ParserException { try { return (Node) expr.evaluate(context, XPathConstants.NODE); } catch (XPathException e) { throw new ParserException("Unable to find node", -1, e); } }
throw new CosmoDavException(e); } catch (ParserException e) { throw new InvalidCalendarDataException("Calendar object not parseable: " + e.getMessage()); } catch (ValidationException e) { throw new InvalidCalendarDataException("Invalid calendar object: " + e.getMessage());