KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > java > plugin > registry > IntegrityCheckReport


1 /*****************************************************************************
2  * Java Plug-in Framework (JPF)
3  * Copyright (C) 2004-2005 Dmitry Olshansky
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *****************************************************************************/

19 package org.java.plugin.registry;
20
21 import java.util.Collection JavaDoc;
22 import java.util.Locale JavaDoc;
23
24
25 /**
26  * Result of validation performed by registry on all registered plug-ins. This
27  * includes dependencies check, parameters check (against parameter definitions)
28  * and any other kind of validation.
29  * @version $Id: IntegrityCheckReport.java,v 1.1 2005/07/20 18:43:46 ddimon Exp $
30  */

31 public interface IntegrityCheckReport {
32     /**
33      * @return number of items with severity {@link ReportItem#SEVERITY_ERROR}
34      * in this report
35      */

36     int countErrors();
37     
38     /**
39      * @return number of items with severity {@link ReportItem#SEVERITY_WARNING}
40      * in this report
41      */

42     int countWarnings();
43     
44     /**
45      * @return collection of {@link ReportItem} objects
46      */

47     Collection JavaDoc getItems();
48     
49     /**
50      * Integrity check report element. Holds all information about particular
51      * check event.
52      * @version $Id: IntegrityCheckReport.java,v 1.1 2005/07/20 18:43:46 ddimon Exp $
53      */

54     interface ReportItem {
55         /**
56          * Item severity code.
57          */

58         byte SEVERITY_ERROR = 1;
59         
60         /**
61          * Item severity code.
62          */

63         byte SEVERITY_WARNING = 2;
64         
65         /**
66          * Item severity code.
67          */

68         byte SEVERITY_INFO = 3;
69         
70         /**
71          * Item error code.
72          */

73         int ERROR_NO_ERROR = 0;
74         
75         /**
76          * Item error code.
77          */

78         int ERROR_CHECKER_FAULT = 1;
79         
80         /**
81          * Item error code.
82          */

83         int ERROR_MANIFEST_PROCESSING_FAILED = 2;
84         
85         /**
86          * Item error code.
87          */

88         int ERROR_UNSATISFIED_PREREQUISITE = 3;
89         
90         /**
91          * Item error code.
92          */

93         int ERROR_BAD_LIBRARY = 4;
94         
95         /**
96          * Item error code.
97          */

98         int ERROR_INVALID_EXTENSION_POINT = 5;
99         
100         /**
101          * Item error code.
102          */

103         int ERROR_INVALID_EXTENSION = 6;
104         
105         /**
106          * @return severity code for this report item
107          */

108         byte getSeverity();
109         
110         /**
111          * @return source for this report item, can be <code>null</code>
112          */

113         Identity getSource();
114         
115         /**
116          * @return error code for this report item
117          */

118         int getCode();
119         
120         /**
121          * @return message, associated with this report item for the system
122          * default locale
123          */

124         String JavaDoc getMessage();
125         
126         /**
127          * @param locale locale to get message for
128          * @return message, associated with this report item for given locale
129          */

130         String JavaDoc getMessage(Locale JavaDoc locale);
131     }
132 }
133
Popular Tags