View Javadoc

1   /*
2    * $Id: IConfigurationValidator.java,v 1.3 2005/05/31 16:04:12 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8    
9   package com.bbn.swede.core.libraries;
10  
11  import java.util.Map;
12  
13  /***
14   * Interface to decide whether IConfiguration objects are valid.
15   * 
16   * @author aperezlo
17   */
18  public interface IConfigurationValidator
19  {
20     /***
21      * Indicates whether a given configuration is valid.
22      * @param props The configuration to check
23      * @return <code>true</code> if <code>props</code> is valid, 
24      *         <code>false</code> otherwise
25      */
26     boolean isValid(IConfiguration props);
27     /***
28      * Indicates whether a specific property from a configuration is valid.
29      * @param property a generalized representation of a single property 
30      *                 of a configuration
31      * @return <code>true</code> if this is a valid property, 
32      *         <code>false</code> otherwise
33      */
34     boolean isValid(Map.Entry property);
35  
36     /***
37      * Retrieves any error messages generated during validation.
38      * @return an array containing all error messages generated during the 
39      *         validation operation
40      */
41     String[] getErrorMessages();
42  }