ValidationRegistryManager.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright 2004, 2005 Acegi Technology Pty Limited
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. package net.sf.acegisecurity.domain.validation;
  16. import org.springframework.validation.Validator;
  17. /**
  18. * <code>ValidationRegistryManager</code> implementations are able to
  19. * authoritatively return a <code>Validator</code> instance that is suitable
  20. * for a given domain object.
  21. *
  22. * <p>
  23. * Implementations are free to implement their own strategy for maintaining the
  24. * list of <code>Validator</code>s, or create them on-demand if preferred.
  25. * This interface is non-prescriptive.
  26. * </p>
  27. *
  28. * @author Matthew E. Porter
  29. * @author Ben Alex
  30. * @version $Id$
  31. */
  32. public interface ValidationRegistryManager {
  33. //~ Methods ================================================================
  34. /**
  35. * Obtains the <code>Validator</code> that applies for a given domain
  36. * object class.
  37. *
  38. * @param domainClass that a <code>Validator</code> is required for
  39. *
  40. * @return the <code>Validator</code>, or <code>null</code> if no
  41. * <code>Validator</code> is known for the indicated
  42. * <code>domainClass</code>
  43. */
  44. public Validator findValidator(Class domainClass);
  45. }