java.lang.Object
net.fortuna.ical4j.validate.ValidationRule<T>
- All Implemented Interfaces:
Serializable
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.
Alternatively, a Predicate may be specified to provide additional validation beyond the presence/absence of content.
For example, a predicate may be used to ensure certain date properties are DATE/DATE-TIME values.
Note that the predicate must specify the negative case, such that if it evaluates true the rule fails.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionValidationRule(Predicate<T> predicate, String message, boolean relaxedModeSupported, String... instances) ValidationRule(Predicate<T> predicate, String message, String... instances) ValidationRule(ValidationRule.ValidationType type, boolean relaxedModeSupported, String... instances) ValidationRule(ValidationRule.ValidationType type, String... instances) -
Method Summary
-
Constructor Details
-
ValidationRule
- Parameters:
type- rule typeinstances- list of identifiers to check (parameter, property, component, etc.)
-
ValidationRule
public ValidationRule(ValidationRule.ValidationType type, boolean relaxedModeSupported, String... instances) - Parameters:
type- rule typerelaxedModeSupported- indicates if rule can be ignored when relaxed mode is enabledinstances- list of identifiers to check (parameter, property, component, etc.)
-
ValidationRule
- Parameters:
predicate- a negative predicate, such that a successful test indicates a rule violationmessage- the message used to indicate a rule violationinstances- identifiers for instances under test
-
ValidationRule
-
-
Method Details
-
getType
-
getPredicate
-
getInstances
-
getMessage
-
getSeverity
-