fr.paris.lutece.plugins.form.service
Class ValidatorService

java.lang.Object
  extended by fr.paris.lutece.plugins.form.service.ValidatorService

public class ValidatorService
extends java.lang.Object

ValidatorService


Method Summary
 java.util.Collection<IValidator> getAllValidators()
          Returns all validators
static ValidatorService getInstance()
          Returns the unique instance of ValidatorService
 IValidator getValidatorByKey(java.lang.String strKey)
          Returns the validator which the key is specified in parameter
 void register(java.lang.String strKey, IValidator validator)
          Registers a validator
 void removeAssociationsWithForm(int nIdForm)
          Removes the associations between all validators and the form
 void unregister(java.lang.String strKey)
          Unregisters a validator
 void validateForm(javax.servlet.http.HttpServletRequest request, FormSubmit formSubmit)
          Validates the form using all validators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ValidatorService getInstance()
Returns the unique instance of ValidatorService

Returns:
the unique instance of ValidatorService

register

public void register(java.lang.String strKey,
                     IValidator validator)
Registers a validator

Parameters:
strKey - the validator key
validator - the validator

unregister

public void unregister(java.lang.String strKey)
Unregisters a validator

Parameters:
strKey - the validator key

getValidatorByKey

public IValidator getValidatorByKey(java.lang.String strKey)
Returns the validator which the key is specified in parameter

Parameters:
strKey - the validator key
Returns:
the validator which the key is specified in parameter

getAllValidators

public java.util.Collection<IValidator> getAllValidators()
Returns all validators

Returns:
all validators

validateForm

public void validateForm(javax.servlet.http.HttpServletRequest request,
                         FormSubmit formSubmit)
Validates the form using all validators

Parameters:
request - HttpServletRequest
formSubmit - the form submit

removeAssociationsWithForm

public void removeAssociationsWithForm(int nIdForm)
Removes the associations between all validators and the form

Parameters:
nIdForm - the form id


Copyright © 2010 Mairie de Paris. All Rights Reserved.