All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.fortuna.ical4j.validate.component.VAlarmProcedureValidator Maven / Gradle / Ivy

There is a newer version: 4.0.4
Show newest version
package net.fortuna.ical4j.validate.component;

import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.component.VAlarm;
import net.fortuna.ical4j.validate.PropertyValidator;
import net.fortuna.ical4j.validate.ValidationException;
import net.fortuna.ical4j.validate.Validator;

/**
 * Created by fortuna on 12/09/15.
 */
public class VAlarmProcedureValidator implements Validator {

    private static final long serialVersionUID = 1L;

    /**
     * {@inheritDoc}
     */
    public void validate(VAlarm target) throws ValidationException {
        /*
         * ; the following are all REQUIRED,
         * ; but MUST NOT occur more than once action / attach / trigger /
         * ; 'duration' and 'repeat' are both optional,
         * ; and MUST NOT occur more than once each,
         * ; but if one occurs, so MUST the other duration / repeat /
         * ; 'description' is optional,
         * ; and MUST NOT occur more than once description /
         * ; the following is optional, ; and MAY occur more than once x-prop
         */
        PropertyValidator.getInstance().assertOne(Property.ATTACH, target.getProperties());

        PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION, target.getProperties());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy