KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > interfaces > ConfigurationValidator


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.phoenix.interfaces;
9
10 import org.apache.avalon.framework.configuration.Configuration;
11 import org.apache.avalon.framework.configuration.ConfigurationException;
12
13 /**
14  * Handles parsing of configuration schema and validation against schema
15  *
16  * @author <a HREF="mailto:proyal@apache.org">Peter Royal</a>
17  * @version CVS $Revision: 1.4 $ $Date: 2002/07/26 09:49:22 $
18  */

19 public interface ConfigurationValidator
20 {
21     String JavaDoc ROLE = ConfigurationValidator.class.getName();
22
23     /**
24      * Add configuration schema to validator
25      *
26      * @param application Application name
27      * @param block Block name to store configuration for
28      * @param url url that the schema may be located at
29      *
30      * @throws ConfigurationException if schema is invalid
31      */

32     void addSchema( String JavaDoc application, String JavaDoc block, String JavaDoc schemaType, String JavaDoc url )
33         throws ConfigurationException;
34
35     /**
36      * Add configuration schema to validator
37      *
38      * @param application Application name
39      * @param block Block name to store configuration for
40      * @param url url that the schema may be located at
41      *
42      * @throws ConfigurationException if schema is invalid
43      */

44     void removeSchema( String JavaDoc application, String JavaDoc block );
45
46     /**
47      * Check to see if configuration is feasibly valid. That is, does this configuration match
48      * the schema in its current state, but not neccessarily fullfill the requirements of the
49      * schema.
50      *
51      * Implementations are not required to support checking feasibility. If feasibility cannot
52      * be checked, the implementation should always return true
53      *
54      * @param application Application name
55      * @param block Block name to store configuration for
56      * @param configuration Configuration to check
57      *
58      * @return true if configuration is feasibly valid
59      *
60      * @throws ConfigurationException if no schema is found
61      */

62     boolean isFeasiblyValid( String JavaDoc application, String JavaDoc block, Configuration configuration )
63         throws ConfigurationException;
64
65     /**
66      * Check to see if configuration is valid.
67      *
68      * @param application Application name
69      * @param block Block name to store configuration for
70      * @param configuration Configuration to check
71      *
72      * @return true if configuration is valid
73      *
74      * @throws ConfigurationException if no schema is found
75      */

76     boolean isValid( String JavaDoc application, String JavaDoc block, Configuration configuration )
77         throws ConfigurationException;
78 }
79
Popular Tags