/** * Remove a property from the list. * @param property the property to remove * @return true if the list contained the specified property * @see java.util.List#remove(java.lang.Object) */ public final boolean remove(final Property property) { return remove((Object) property); } }
/** * Remove a property from the list. * @param property the property to remove * @return true if the list contained the specified property * @see java.util.List#remove(java.lang.Object) */ public final boolean remove(final Property property) { return remove((Object) property); } }
private void removeProperty(VEvent e, String name) { Property p = e.getProperty(name); if (p != null) e.getProperties().remove(p); }
@Override public Calendar transform(Calendar object) { PropertyList<Property> calProps = object.getProperties(); Property oldMethod = calProps.getProperty(Property.METHOD); if (oldMethod != null) { calProps.remove(oldMethod); } calProps.add(this.newMethod); return object; } }
@Override public Component transform(Component object) { PropertyList<Property> props = object.getProperties(); Organizer oldOrganizer = props.getProperty(Property.ORGANIZER); if (oldOrganizer != null) { props.remove(oldOrganizer); } props.add(organizer); return object; } }
@Override public Calendar transform(Calendar object) { PropertyList<Property> calProps = object.getProperties(); Property oldMethod = calProps.getProperty(Property.METHOD); if (oldMethod != null) { calProps.remove(oldMethod); } calProps.add(this.newMethod); return object; } }
@Override public Component transform(Component object) { PropertyList<Property> props = object.getProperties(); Organizer oldOrganizer = props.getProperty(Property.ORGANIZER); if (oldOrganizer != null) { props.remove(oldOrganizer); } props.add(organizer); return object; } }
protected static void replaceProperty(PropertyList propertyList, Property property) { if (property == null) { return; } Property existingProp = propertyList.getProperty(property.getName()); if (existingProp != null) { propertyList.remove(existingProp); } propertyList.add(property); }
public void setRecurrenceRules(List<Recur> recurs) { if (recurs == null) { return; } PropertyList<Property> properties = getEvent().getProperties(); for (Property rrule : properties.getProperties(Property.RRULE)) { properties.remove(rrule); } for (Recur recur : recurs) { properties.add(new RRule(recur)); } }
protected void limitApparitionsNumberIn(Component component){ PropertyList<? extends Property> propertyList = component.getProperties(name); if(propertyList.size() <= maxApparitionNumber){ return; } int toRemove = propertyList.size() - maxApparitionNumber; for(int i = 0; i < toRemove; i++){ component.getProperties().remove(propertyList.get(i)); } }
protected void limitApparitionsNumberIn(Component component){ PropertyList<? extends Property> propertyList = component.getProperties(name); if(propertyList.size() <= maxApparitionNumber){ return; } int toRemove = propertyList.size() - maxApparitionNumber; for(int i = 0; i < toRemove; i++){ component.getProperties().remove(propertyList.get(i)); } }
protected void limitApparitionsNumberIn(Component component){ PropertyList<? extends Property> propertyList = component.getProperties(name); if(propertyList.size() <= maxApparitionNumber){ return; } int toRemove = propertyList.size() - maxApparitionNumber; for(int i = 0; i < toRemove; i++){ component.getProperties().remove(propertyList.get(i)); } }
public void setExceptionRules(List<Recur> recurs) { if (recurs == null) { return; } PropertyList<Property> properties = getEvent().getProperties(); for (Property exrule : properties.getProperties(Property.EXRULE)) { properties.remove(exrule); } for (Recur recur : recurs) { properties.add(new ExRule(recur)); } }
public void setRecurrenceRules(List<Recur> recurs) { if (recurs == null) { return; } PropertyList<Property> properties = getEvent().getProperties(); for (Property rrule : properties.getProperties(Property.RRULE)) { properties.remove(rrule); } for (Recur recur : recurs) { properties.add(new RRule(recur)); } }
public void setExceptionRules(List<Recur> recurs) { if (recurs == null) { return; } PropertyList<Property> properties = getEvent().getProperties(); for (Property exrule : properties.getProperties(Property.EXRULE)) { properties.remove(exrule); } for (Recur recur : recurs) { properties.add(new ExRule(recur)); } }
@Override public Component transform(Component object) { PropertyList<Attendee> attendees = object.getProperties().getProperties(Property.ATTENDEE); if (attendees.contains(attendee)) { attendees.remove(attendee); } attendees.add(attendee); object.getProperties().addAll(attendees); return object; } }
@Override public Component transform(Component object) { PropertyList<Attendee> attendees = object.getProperties().getProperties(Property.ATTENDEE); if (attendees.contains(attendee)) { attendees.remove(attendee); } attendees.add(attendee); object.getProperties().addAll(attendees); return object; } }
/** * Adds or replaces the property in a component. * @param component Component to modify. * @param property Property to add or update. */ public static void addOrReplaceProperty(Component component, Property property){ Property oldProp = component.getProperties().getProperty(property.getName()); if (oldProp != null){ component.getProperties().remove(oldProp); } component.getProperties().add(property); }
@Override public CalendarComponent transform(CalendarComponent object) { PropertyList compProps = object.getProperties(); Sequence sequence = (Sequence) compProps .getProperty(Property.SEQUENCE); if (sequence == null) { compProps.add(new Sequence(0)); } else { compProps.remove(sequence); compProps.add(new Sequence(sequence.getSequenceNo() + 1)); } return object; } }
/** * Test method for {@link net.fortuna.ical4j.data.HCalendarParser#parse(java.io.Reader, net.fortuna.ical4j.data.ContentHandler)}. */ public void testParseReaderContentHandler() throws IOException, ParserException { Calendar icsCalendar = Calendars.load(getClass().getResource("/samples/hcalendar/example1.ics")); // remove prod-id which seems to be not handled by hcalendar.. icsCalendar.getProperties().remove(icsCalendar.getProperty(Property.PRODID)); CalendarBuilder builder = new CalendarBuilder(new HCalendarParser()); Calendar hcalCalendar = builder.build(getClass().getResourceAsStream("/samples/hcalendar/example1.html")); // assertEquals(icsCalendar, hcalCalendar); assertEquals(icsCalendar.getProperties().size(), hcalCalendar.getProperties().size()); assertEquals(icsCalendar.getComponents().size(), hcalCalendar.getComponents().size()); }