private Property getProp(String name) { if (pl == null) { // Empty Component return null; } return pl.getProperty(name); }
/** * Convenience method for retrieving a named property. * * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final <T extends Property> T getProperty(final String name) { return (T) getProperties().getProperty(name); }
/** * Ensure a property doesn't occur in the specified list. * @param propertyName the name of a property * @param properties a list of properties * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException { if (properties.getProperty(propertyName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName}); } }
/** * Convenience method for retrieving a named property. * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final <T extends Property> T getProperty(final String name) { return getProperties().getProperty(name); }
/** * Convenience method for retrieving a named property. * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final Property getProperty(final String name) { return getProperties().getProperty(name); }
/** * Convenience method for retrieving a named property. * * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final Property getProperty(final String name) { return getProperties().getProperty(name); }
/** * Ensure a property doesn't occur in the specified list. * @param propertyName the name of a property * @param properties a list of properties * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException { if (properties.getProperty(propertyName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName}); } }
/** * Convenience method for retrieving a named property. * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final <T extends Property> T getProperty(final String name) { return getProperties().getProperty(name); }
public Trigger getDisplayAlarmTrigger() { VAlarm alarm = getDisplayAlarm(); if(alarm==null) { return null; } return (Trigger) alarm.getProperties().getProperty(Property.TRIGGER); }
/** Get the method for the calendar * * @param val * @return String method */ public static String getMethod(final Calendar val) { Property prop = val.getProperties().getProperty(Property.METHOD); if (prop == null) { return null; } return prop.getValue(); }
/** * Gets start date. * * @param comp The component. * @return The date. */ private Date getStartDate(Component comp) { DtStart prop = (DtStart) comp.getProperties().getProperty( Property.DTSTART); return (prop != null) ? prop.getDate() : null; }
/** * Gets recurrence id. * * @param comp The component. * @return The date. */ private final Date getRecurrenceId(Component comp) { RecurrenceId rid = (RecurrenceId) comp.getProperties().getProperty( Property.RECURRENCE_ID); return (rid != null) ? rid.getDate() : null; }
@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 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; } }
public String getDisplayAlarmDescription() { VAlarm alarm = getDisplayAlarm(); if(alarm==null) { return null; } Description description = (Description) alarm.getProperties() .getProperty(Property.DESCRIPTION); if(description==null) { return null; } return description.getValue(); }
public String getLocation() { Property p = getEvent().getProperties(). getProperty(Property.LOCATION); if (p == null) { return null; } return p.getValue(); }
public Integer getDisplayAlarmRepeat() { VAlarm alarm = getDisplayAlarm(); if(alarm==null) { return null; } Repeat repeat = (Repeat) alarm.getProperties().getProperty(Property.REPEAT); if(repeat==null) { return null; } return repeat.getCount(); }
@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 Component transform(Component object) { Uid uid = object.getProperties().getProperty(Property.UID); if (uid == null) { object.getProperties().add(uidGenerator.generateUid()); } return object; } }
public String getTimezoneName() { Calendar timezone = getTimezoneCalendar(); if (timezone == null) { return null; } return timezone.getComponents().getComponent(Component.VTIMEZONE). getProperties().getProperty(Property.TZID).getValue(); }