Package net.fortuna.ical4j.validate
Class ComponentValidator<T extends Component>
- java.lang.Object
-
- net.fortuna.ical4j.validate.AbstractValidator<T>
-
- net.fortuna.ical4j.validate.ComponentValidator<T>
-
- All Implemented Interfaces:
Serializable
,Validator<T>
- Direct Known Subclasses:
VEventValidator
,VToDoValidator
public class ComponentValidator<T extends Component> extends AbstractValidator<T>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ComponentValidator<Available>
AVAILABLE
static ValidationRule<ComponentContainer<?>>
NO_ALARMS
static ComponentValidator<Observance>
OBSERVANCE_ITIP
static ComponentValidator<Participant>
PARTICIPANT
static ComponentValidator<VAlarm>
VALARM_AUDIO
static ComponentValidator<VAlarm>
VALARM_DISPLAY
static ComponentValidator<VAlarm>
VALARM_EMAIL
static ComponentValidator<VAlarm>
VALARM_ITIP
static ComponentValidator<VAvailability>
VAVAILABILITY
static ComponentValidator<VEvent>
VEVENT
static ComponentValidator<VFreeBusy>
VFREEBUSY
static ComponentValidator<VJournal>
VJOURNAL
static ComponentValidator<VLocation>
VLOCATION
static ComponentValidator<VResource>
VRESOURCE
static ComponentValidator<VTimeZone>
VTIMEZONE
static ComponentValidator<VToDo>
VTODO
static ComponentValidator<VVenue>
VVENUE
-
Constructor Summary
Constructors Constructor Description ComponentValidator(String context, ValidationRule<T>... rules)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
assertNone(String componentName, ComponentList<?> components)
Deprecated.static void
assertOneOrLess(String componentName, ComponentList<?> components)
Deprecated.ValidationResult
validate(T target)
Validates the target content by applying validation rules.
-
-
-
Field Detail
-
AVAILABLE
public static final ComponentValidator<Available> AVAILABLE
-
PARTICIPANT
public static final ComponentValidator<Participant> PARTICIPANT
-
VAVAILABILITY
public static final ComponentValidator<VAvailability> VAVAILABILITY
-
VEVENT
public static final ComponentValidator<VEvent> VEVENT
-
VFREEBUSY
public static final ComponentValidator<VFreeBusy> VFREEBUSY
-
VJOURNAL
public static final ComponentValidator<VJournal> VJOURNAL
-
VLOCATION
public static final ComponentValidator<VLocation> VLOCATION
-
VRESOURCE
public static final ComponentValidator<VResource> VRESOURCE
-
VTIMEZONE
public static final ComponentValidator<VTimeZone> VTIMEZONE
-
VTODO
public static final ComponentValidator<VToDo> VTODO
-
VVENUE
public static final ComponentValidator<VVenue> VVENUE
-
OBSERVANCE_ITIP
public static final ComponentValidator<Observance> OBSERVANCE_ITIP
-
VALARM_AUDIO
public static final ComponentValidator<VAlarm> VALARM_AUDIO
-
VALARM_DISPLAY
public static final ComponentValidator<VAlarm> VALARM_DISPLAY
-
VALARM_EMAIL
public static final ComponentValidator<VAlarm> VALARM_EMAIL
-
VALARM_ITIP
public static final ComponentValidator<VAlarm> VALARM_ITIP
-
NO_ALARMS
public static final ValidationRule<ComponentContainer<?>> NO_ALARMS
-
-
Constructor Detail
-
ComponentValidator
@SafeVarargs public ComponentValidator(String context, ValidationRule<T>... rules)
-
-
Method Detail
-
validate
public ValidationResult validate(T target) throws ValidationException
Description copied from interface:Validator
Validates the target content by applying validation rules. When content fails validation the validator may throw an exception depending on the implementation.- Specified by:
validate
in interfaceValidator<T extends Component>
- Overrides:
validate
in classAbstractValidator<T extends Component>
- Parameters:
target
- the target of validation- Returns:
- the result of validation applied to the specified target
- Throws:
ValidationException
- indicates validation failure (implementation-specific)
-
assertNone
@Deprecated public static void assertNone(String componentName, ComponentList<?> components) throws ValidationException
Deprecated.- Parameters:
componentName
- a component name used in the assertioncomponents
- a list of components- Throws:
ValidationException
- where the assertion fails
-
assertOneOrLess
@Deprecated public static void assertOneOrLess(String componentName, ComponentList<?> components) throws ValidationException
Deprecated.- Parameters:
componentName
- a component name used in the assertioncomponents
- a list of components- Throws:
ValidationException
- where the assertion fails
-
-