public VEvent getExceptionEvent() { return (VEvent) getEventCalendar().getComponents().getComponents( Component.VEVENT).get(0); }
/** * Returns the first component containing a property with the specified * value. * @param propertyValue the value of the property identified in the returned * component * @return a component or null if no component is found containing a property * with the specified value */ public T getComponent(final String propertyValue) { final ComponentList<T> components = getComponents(propertyValue); if (!components.isEmpty()) { return components.get(0); } return null; } }
public VEvent getExceptionEvent() { return (VEvent) getEventCalendar().getComponents().getComponents( Component.VEVENT).get(0); }
/** * Returns the first component containing a property with the specified * value. * @param propertyValue the value of the property identified in the returned * component * @return a component or null if no component is found containing a property * with the specified value */ public T getComponent(final String propertyValue) { final ComponentList<T> components = getComponents(propertyValue); if (!components.isEmpty()) { return components.get(0); } return null; } }
public boolean isValid(Calendar value, ConstraintValidatorContext context) { if(value==null) { return true; } try { Calendar calendar = (Calendar) value; // validate entire icalendar object calendar.validate(true); // make sure we have a VTIMEZONE VTimeZone timezone = (VTimeZone) calendar.getComponents() .getComponents(Component.VTIMEZONE).get(0); return timezone != null; } catch(ValidationException ve) { return false; } catch (RuntimeException e) { return false; } }
/** * Returns the first component containing a property with the specified * value. * @param propertyValue the value of the property identified in the returned * component * @return a component or null if no component is found containing a property * with the specified value */ public T getComponent(final String propertyValue) { final ComponentList<T> components = getComponents(propertyValue); if (!components.isEmpty()) { return components.get(0); } return null; } }
public boolean isValid(Calendar value, ConstraintValidatorContext context) { if(value==null) { return true; } try { Calendar calendar = (Calendar) value; // validate entire icalendar object calendar.validate(true); // make sure we have a VTIMEZONE VTimeZone timezone = (VTimeZone) calendar.getComponents() .getComponents(Component.VTIMEZONE).get(0); return timezone != null; } catch(ValidationException ve) { return false; } catch (RuntimeException e) { return false; } }
/** * Returns the first component containing a property with the specified * value. * @param propertyValue the value of the property identified in the returned * component * @return a component or null if no component is found containing a property * with the specified value */ public T getComponent(final String propertyValue) { final ComponentList<T> components = getComponents(propertyValue); if (!components.isEmpty()) { return components.get(0); } return null; } }
public VEvent getMasterEvent() { if(getEventCalendar()==null) { return null; } ComponentList<VEvent> events = getEventCalendar().getComponents().getComponents( Component.VEVENT); if(events.size()==0) { return null; } return (VEvent) events.get(0); }
/** * Parse icalendar string into calendar component * @param calendar icalendar string * @return Component object * @throws ParserException - if something is wrong this exception is thrown. * @throws IOException - if something is wrong this exception is thrown. */ public static Component parseComponent(String component)throws ParserException, IOException { if (component == null) { return null; } // Don't use dispenser as this method may be called from within // a build() as in the case of the custom timezone registry // parsing a timezone CalendarBuilder builder = new CalendarBuilder(); StringReader sr = new StringReader("BEGIN:VCALENDAR\n" + component + "END:VCALENDAR"); return (Component) builder.build(sr).getComponents().get(0); }
public VEvent getMasterEvent() { if(getEventCalendar()==null) { return null; } ComponentList<VEvent> events = getEventCalendar().getComponents().getComponents( Component.VEVENT); if(events.size()==0) { return null; } return (VEvent) events.get(0); }
/** * Parse icalendar string into calendar component * @param calendar icalendar string * @return Component object * @throws ParserException - if something is wrong this exception is thrown. * @throws IOException - if something is wrong this exception is thrown. */ public static Component parseComponent(String component)throws ParserException, IOException { if (component == null) { return null; } // Don't use dispenser as this method may be called from within // a build() as in the case of the custom timezone registry // parsing a timezone CalendarBuilder builder = new CalendarBuilder(); StringReader sr = new StringReader("BEGIN:VCALENDAR\n" + component + "END:VCALENDAR"); return (Component) builder.build(sr).getComponents().get(0); }
VEvent event = (VEvent) comps.get(0);
/** * Evaluates. * @param comps The component list. * @param filter The time range filter. * @return the result. */ private boolean evaluate(ComponentList<? extends Component> comps, TimeRangeFilter filter) { Component comp = (Component) comps.get(0); if(comp instanceof VEvent) { return evaluateVEventTimeRange(comps, filter); } else if(comp instanceof VFreeBusy) { return evaulateVFreeBusyTimeRange((VFreeBusy) comp, filter); } else if(comp instanceof VToDo) { return evaulateVToDoTimeRange(comps, filter); } else if(comp instanceof VJournal) { return evaluateVJournalTimeRange((VJournal) comp, filter); } else if(comp instanceof VAlarm) { return evaluateVAlarmTimeRange(comps, filter); } else { return false; } }
latestSeasonalTime = seasonalTimes.get(0);
/** * Evaluates. * @param comps The component list. * @param filter The time range filter. * @return the result. */ private boolean evaluate(ComponentList<? extends Component> comps, TimeRangeFilter filter) { Component comp = (Component) comps.get(0); if(comp instanceof VEvent) { return evaluateVEventTimeRange(comps, filter); } else if(comp instanceof VFreeBusy) { return evaulateVFreeBusyTimeRange((VFreeBusy) comp, filter); } else if(comp instanceof VToDo) { return evaulateVToDoTimeRange(comps, filter); } else if(comp instanceof VJournal) { return evaluateVJournalTimeRange((VJournal) comp, filter); } else if(comp instanceof VAlarm) { return evaluateVAlarmTimeRange(comps, filter); } else { return false; } }
latestSeasonalTime = seasonalTimes.get(0);
ComponentList<CalendarComponent> comps = calendar.getComponents(Component.VEVENT); assertTrue("VEVENT not found", comps.size() == 1); VEvent vevent = (VEvent) comps.get(0);
latestSeasonalTime = seasonalTimes.get(0);
latestSeasonalTime = seasonalTimes.get(0);