Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Oct 23, 2021
1 parent d669996 commit 22b5f90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/main/java/net/fortuna/ical4j/validate/ValidationRule.java
Expand Up @@ -4,6 +4,13 @@
import java.util.Arrays;
import java.util.List;

/**
* Defines a rule for validating iCalendar content. A rule consists of a validation type (e.g. presence/absence of
* specific content), and one or more identifiers (names) of iCalendar content.
*
* For example, a rule might define a test for one or less DTEND properties using the "OneOrLess" validation type
* and "DTEND" identifier.
*/
public class ValidationRule implements Serializable {

public enum ValidationType { None, One, OneOrLess, OneOrMore }
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/net/fortuna/ical4j/validate/Validator.java
Expand Up @@ -38,8 +38,10 @@
import java.util.function.Predicate;

/**
* @author fortuna
* Implementors apply validation rules to iCalendar content to determine a level of compliance with the published
* specifications.
*
* @author fortuna
*/
public interface Validator<T> extends Serializable {

Expand All @@ -56,8 +58,9 @@ static <T> void assertFalse(Predicate<T> predicate, String message, boolean warn
}

/**
* Validates the associated model against an applicable standard.
* @throws ValidationException where the model does not confirm to the applicable standard
* Validates the target content by applying validation rules. When content fails validation the validator
* may throw an exception depending on the implementation.
* @throws ValidationException indicates validation failure (implementation-specific)
*/
void validate(T target) throws ValidationException;
}

0 comments on commit 22b5f90

Please sign in to comment.