net.fortuna.ical4j.validate.component.VTimeZoneValidator Maven / Gradle / Ivy
package net.fortuna.ical4j.validate.component;
import net.fortuna.ical4j.model.component.Observance;
import net.fortuna.ical4j.model.component.VTimeZone;
import net.fortuna.ical4j.validate.ComponentValidator;
import net.fortuna.ical4j.validate.ValidationException;
import net.fortuna.ical4j.validate.ValidationRule;
import net.fortuna.ical4j.validate.Validator;
import static net.fortuna.ical4j.model.Property.*;
import static net.fortuna.ical4j.validate.ValidationRule.ValidationType.One;
import static net.fortuna.ical4j.validate.ValidationRule.ValidationType.OneOrLess;
public class VTimeZoneValidator extends ComponentValidator {
private final Validator itipValidator = new ComponentValidator<>(
new ValidationRule<>(One, DTSTART, TZOFFSETFROM, TZOFFSETTO),
new ValidationRule<>(OneOrLess, TZNAME));
@SafeVarargs
public VTimeZoneValidator(ValidationRule... rules) {
super(rules);
}
@Override
public void validate(VTimeZone target) throws ValidationException {
super.validate(target);
target.getObservances().getAll().forEach(itipValidator::validate);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy