public void validate(final VFreeBusy target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(FREEBUSY, target.getProperties()); Arrays.asList(DTSTAMP, DTSTART, DTEND, ORGANIZER, UID).forEach(property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); PropertyValidator.getInstance().assertOneOrLess(URL, target.getProperties()); Arrays.asList(ATTENDEE, DURATION, REQUEST_STATUS).forEach(property -> PropertyValidator.getInstance().assertNone(property, target.getProperties())); } }
/** * {@inheritDoc} */ public void validate(VAlarm target) throws ValidationException { /* * ; the following are all REQUIRED, ; but MUST NOT occur more than once action / description / trigger / */ PropertyValidator.getInstance().assertOne(DESCRIPTION, target.getProperties()); } }
@Override public void execute(String input) { PropertyValidator.getInstance().assertOneOrLess(input, getProperties()); } });
@Override public void execute(String input) { PropertyValidator.getInstance().assertNone(input, target.getProperties()); } });
/** * {@inheritDoc} */ public void validate(final VAlarm target) throws ValidationException { /* * ; the following are all REQUIRED, * ; but MUST NOT occur more than once action / description / trigger / summary * ; the following is REQUIRED, * ; and MAY occur more than once attendee / * ; 'duration' and 'repeat' are both optional, * ; and MUST NOT occur more than once each, * ; but if one occurs, so MUST the other duration / repeat / * ; the following are optional, * ; and MAY occur more than once attach / x-prop */ Arrays.asList(DESCRIPTION, SUMMARY).forEach(property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); PropertyValidator.getInstance().assertOneOrMore(ATTENDEE, target.getProperties()); } }
/** * {@inheritDoc} */ public void validate(VTimeZone target) throws ValidationException { for (final Observance observance : target.getObservances()) { PropertyValidator.getInstance().assertOne(Property.DTSTART, observance.getProperties()); PropertyValidator.getInstance().assertOne(Property.TZOFFSETFROM, observance.getProperties()); PropertyValidator.getInstance().assertOne(Property.TZOFFSETTO, observance.getProperties()); PropertyValidator.getInstance().assertOneOrLess(Property.TZNAME, observance.getProperties()); } } }
public void validate(final VJournal target) throws ValidationException { PropertyValidator.getInstance().assertOne(Property.DESCRIPTION, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.DTSTAMP, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.DTSTART, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.ORGANIZER, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.UID, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.CATEGORIES, Property.CLASS, Property.CREATED, Property.LAST_MODIFIED, Property.RECURRENCE_ID, Property.SEQUENCE, Property.STATUS, Property.SUMMARY, Property.URL), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertOneOrLess(input, target.getProperties()); } }); PropertyValidator.getInstance().assertNone(Property.ATTENDEE, target.getProperties()); } }
public void validate(final VFreeBusy target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(Property.FREEBUSY, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.DTSTAMP, Property.DTSTART, Property.DTEND, Property.ORGANIZER, Property.UID), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, target.getProperties()); } }); PropertyValidator.getInstance().assertOneOrLess(Property.URL, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.ATTENDEE, Property.DURATION, Property.REQUEST_STATUS), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertNone(input, target.getProperties()); } }); } }
public void validate(final VFreeBusy target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(Property.ATTENDEE, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.DTEND, Property.DTSTAMP, Property.DTSTART, Property.ORGANIZER, Property.UID), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, target.getProperties()); } }); CollectionUtils.forAllDo(Arrays.asList(Property.FREEBUSY, Property.DURATION, Property.REQUEST_STATUS, Property.URL), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertNone(input, target.getProperties()); } }); } }
/** * {@inheritDoc} */ public void validate(final VAlarm target) throws ValidationException { /* * ; the following are all REQUIRED, * ; but MUST NOT occur more than once action / description / trigger / summary * ; the following is REQUIRED, * ; and MAY occur more than once attendee / * ; 'duration' and 'repeat' are both optional, * ; and MUST NOT occur more than once each, * ; but if one occurs, so MUST the other duration / repeat / * ; the following are optional, * ; and MAY occur more than once attach / x-prop */ Arrays.asList(DESCRIPTION, SUMMARY).forEach(property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); PropertyValidator.getInstance().assertOneOrMore(ATTENDEE, target.getProperties()); } }
/** * {@inheritDoc} */ public void validate(final VAlarm target) throws ValidationException { Arrays.asList(ACTION, TRIGGER).forEach(property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); Arrays.asList(DESCRIPTION, DURATION, REPEAT, SUMMARY).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, target.getProperties())); } }
@Override public void execute(String input) { PropertyValidator.getInstance().assertNone(input, target.getProperties()); } });
@Override public void execute(String input) { PropertyValidator.getInstance().assertOneOrLess(input, target.getProperties()); } });
/** * {@inheritDoc} */ public void validate(VAlarm target) throws ValidationException { /* * ; the following are all REQUIRED, ; but MUST NOT occur more than once action / description / trigger / */ PropertyValidator.getInstance().assertOne(DESCRIPTION, target.getProperties()); } }
public void validate(final VJournal target) throws ValidationException { PropertyValidator.getInstance().assertOne(Property.DTSTAMP, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.ORGANIZER, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.SEQUENCE, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.UID, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.CATEGORIES, Property.CLASS, Property.CREATED, Property.DESCRIPTION, Property.DTSTART, Property.LAST_MODIFIED, Property.RECURRENCE_ID, Property.STATUS, Property.SUMMARY, Property.URL), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertOneOrLess(input, target.getProperties()); } }); PropertyValidator.getInstance().assertNone(Property.REQUEST_STATUS, target.getProperties()); } }
public void validate(final VFreeBusy target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(Property.FREEBUSY, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.DTSTAMP, Property.DTSTART, Property.DTEND, Property.ORGANIZER, Property.UID), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, target.getProperties()); } }); PropertyValidator.getInstance().assertOneOrLess(Property.URL, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.ATTENDEE, Property.DURATION, Property.REQUEST_STATUS), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertNone(input, target.getProperties()); } }); } }
public void validate(final VFreeBusy target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(Property.ATTENDEE, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.DTEND, Property.DTSTAMP, Property.DTSTART, Property.ORGANIZER, Property.UID), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, target.getProperties()); } }); CollectionUtils.forAllDo(Arrays.asList(Property.FREEBUSY, Property.DURATION, Property.REQUEST_STATUS, Property.URL), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertNone(input, target.getProperties()); } }); } }
public void validate(final VFreeBusy target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(FREEBUSY, target.getProperties()); Arrays.asList(DTSTAMP, DTSTART, DTEND, ORGANIZER, UID).forEach(property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); PropertyValidator.getInstance().assertOneOrLess(URL, target.getProperties()); Arrays.asList(ATTENDEE, DURATION, REQUEST_STATUS).forEach(property -> PropertyValidator.getInstance().assertNone(property, target.getProperties())); } }
public void validate(final VToDo target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(Property.ATTENDEE, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.DTSTAMP, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.ORGANIZER, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.SEQUENCE, target.getProperties()); PropertyValidator.getInstance().assertOne(Property.UID, target.getProperties()); CollectionUtils.forAllDo(Arrays.asList(Property.CATEGORIES, Property.CLASS, Property.CREATED, Property.DESCRIPTION, Property.DTSTART, Property.DUE, Property.DURATION, Property.GEO, Property.LAST_MODIFIED, Property.LOCATION, Property.LOCATION, Property.PERCENT_COMPLETE, Property.PRIORITY, Property.RECURRENCE_ID, Property.RESOURCES, Property.STATUS, Property.URL), new Closure<String>() { @Override public void execute(String input) { PropertyValidator.getInstance().assertOneOrLess(input, target.getProperties()); } }); ComponentValidator.assertNone(Component.VALARM, target.getAlarms()); } }
/** * {@inheritDoc} */ public void validate(final VAlarm target) throws ValidationException { Arrays.asList(ACTION, TRIGGER).forEach(property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); Arrays.asList(DESCRIPTION, DURATION, REPEAT, SUMMARY).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, target.getProperties())); } }