net.fortuna.ical4j.util
Class ParameterValidator

java.lang.Object
  extended by net.fortuna.ical4j.util.ParameterValidator

public final class ParameterValidator
extends Object

$Id$ [15-May-2004] Defines methods for validating parameters and parameter lists.

Author:
Ben Fortuna

Method Summary
 void assertNone(String paramName, ParameterList parameters)
          Ensure a parameter doesn't occur in the specified list.
 void assertNullOrEqual(Parameter param, ParameterList parameters)
           
 void assertOne(String paramName, ParameterList parameters)
          Ensure a parameter occurs once.
 void assertOneOrLess(String paramName, ParameterList parameters)
          Ensure a parameter occurs no more than once.
static ParameterValidator 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 paramName,
                            ParameterList parameters)
                     throws ValidationException
Ensure a parameter occurs no more than once.

Parameters:
paramName - the parameter name
parameters - a list of parameters to query
Throws:
ValidationException - when the specified parameter occurs more than once

assertOne

public void assertOne(String paramName,
                      ParameterList parameters)
               throws ValidationException
Ensure a parameter occurs once.

Parameters:
paramName - the parameter name
parameters - a list of parameters to query
Throws:
ValidationException - when the specified parameter does not occur once

assertNone

public void assertNone(String paramName,
                       ParameterList parameters)
                throws ValidationException
Ensure a parameter doesn't occur in the specified list.

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

assertNullOrEqual

public void assertNullOrEqual(Parameter param,
                              ParameterList parameters)
                       throws ValidationException
Parameters:
param - a parameter instance
parameters - a list of parameters
Throws:
ValidationException - where the assertion fails

getInstance

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


Copyright © 2004-2012 Micronode. All Rights Reserved.