Package net.fortuna.ical4j.validate
Class PropertyValidator
- java.lang.Object
-
- net.fortuna.ical4j.validate.PropertyValidator
-
- All Implemented Interfaces:
Serializable
,Validator<Property>
public final class PropertyValidator extends Object implements Validator<Property>
$Id$ [15-May-2004] Defines methods for validating properties and property lists.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ASSERT_NONE_MESSAGE
static String
ASSERT_ONE_MESSAGE
static String
ASSERT_ONE_OR_LESS_MESSAGE
static String
ASSERT_ONE_OR_MORE_MESSAGE
-
Constructor Summary
Constructors Constructor Description PropertyValidator(List<ValidationRule> rules)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
assertNone(String propertyName, PropertyList properties)
Ensure a property doesn't occur in the specified list.static void
assertOne(String propertyName, PropertyList properties)
Ensure a property occurs once.static void
assertOneOrLess(String propertyName, PropertyList properties)
Ensure a property occurs no more than once.static void
assertOneOrMore(String propertyName, PropertyList properties)
Ensure a property occurs at least once.void
validate(Property target)
Validates the associated model against an applicable standard.
-
-
-
Field Detail
-
ASSERT_NONE_MESSAGE
public static final String ASSERT_NONE_MESSAGE
- See Also:
- Constant Field Values
-
ASSERT_ONE_OR_LESS_MESSAGE
public static final String ASSERT_ONE_OR_LESS_MESSAGE
- See Also:
- Constant Field Values
-
ASSERT_ONE_MESSAGE
public static final String ASSERT_ONE_MESSAGE
- See Also:
- Constant Field Values
-
ASSERT_ONE_OR_MORE_MESSAGE
public static final String ASSERT_ONE_OR_MORE_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PropertyValidator
public PropertyValidator(List<ValidationRule> rules)
-
-
Method Detail
-
validate
public void validate(Property target) throws ValidationException
Description copied from interface:Validator
Validates the associated model against an applicable standard.- Specified by:
validate
in interfaceValidator<Property>
- Throws:
ValidationException
- where the model does not confirm to the applicable standard
-
assertOneOrLess
public static void assertOneOrLess(String propertyName, PropertyList properties) throws ValidationException
Ensure a property occurs no more than once.- Parameters:
propertyName
- the property nameproperties
- a list of properties to query- Throws:
ValidationException
- when the specified property occurs more than once
-
assertOneOrMore
public static void assertOneOrMore(String propertyName, PropertyList properties) throws ValidationException
Ensure a property occurs at least once.- Parameters:
propertyName
- the property nameproperties
- a list of properties to query- Throws:
ValidationException
- when the specified property occurs more than once
-
assertOne
public static void assertOne(String propertyName, PropertyList properties) throws ValidationException
Ensure a property occurs once.- Parameters:
propertyName
- the property nameproperties
- a list of properties to query- Throws:
ValidationException
- when the specified property does not occur once
-
assertNone
public static void assertNone(String propertyName, PropertyList properties) throws ValidationException
Ensure a property doesn't occur in the specified list.- Parameters:
propertyName
- the name of a propertyproperties
- a list of properties- Throws:
ValidationException
- thrown when the specified property is found in the list of properties
-
-