net.fortuna.ical4j.util
Class PropertyValidator

java.lang.Object
  extended bynet.fortuna.ical4j.util.PropertyValidator

public final class PropertyValidator
extends Object

Defines methods for validating properties and property lists.

Author:
Ben Fortuna

Method Summary
 void assertNone(String propertyName, PropertyList properties)
          Ensure a property doesn't occur in the specified list.
 void assertOne(String propertyName, PropertyList properties)
          Ensure a property occurs once.
 void assertOneOrLess(String propertyName, PropertyList properties)
          Ensure a property occurs no more than once.
 void assertOneOrMore(String propertyName, PropertyList properties)
          Ensure a property occurs at least once.
static PropertyValidator getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertOneOrLess

public void assertOneOrLess(String propertyName,
                            PropertyList properties)
                     throws ValidationException
Ensure a property occurs no more than once.

Parameters:
propertyName - the property name
properties - a list of properties to query
Throws:
ValidationException - when the specified property occurs more than once

assertOneOrMore

public void assertOneOrMore(String propertyName,
                            PropertyList properties)
                     throws ValidationException
Ensure a property occurs at least once.

Parameters:
propertyName - the property name
properties - a list of properties to query
Throws:
ValidationException - when the specified property occurs more than once

assertOne

public void assertOne(String propertyName,
                      PropertyList properties)
               throws ValidationException
Ensure a property occurs once.

Parameters:
propertyName - the property name
properties - a list of properties to query
Throws:
ValidationException - when the specified property does not occur once

assertNone

public void assertNone(String propertyName,
                       PropertyList properties)
                throws ValidationException
Ensure a property doesn't occur in the specified list.

Parameters:
propertyName - the name of a property
properties - a list of properties
Throws:
ValidationException - thrown when the specified property is found in the list of properties

getInstance

public static PropertyValidator getInstance()
Returns:
Returns the instance.