KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > common > util > Diagnostic


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: Diagnostic.java,v 1.3 2005/06/08 06:19:08 nickb Exp $
16  */

17 package org.eclipse.emf.common.util;
18
19
20 import java.util.List JavaDoc;
21
22
23 /**
24  * Information about the outcome of some activity.
25  */

26 public interface Diagnostic
27 {
28   /**
29    * The bit mask value <code>0x0</code> for a {@link #getSeverity severity} indicating everything is okay.
30    */

31   int OK = 0x0;
32
33   /**
34    * The bit mask value <code>0x1</code> for a {@link #getSeverity severity} indicating there is an informational message.
35    */

36   int INFO = 0x1;
37
38   /**
39    * The bit mask value <code>0x2</code> for a {@link #getSeverity severity} indicating there is warning message.
40    */

41   int WARNING = 0x2;
42
43   /**
44    * The bit mask value <code>0x1</code> for a {@link #getSeverity severity} indicating there is an error message.
45    */

46   int ERROR = 0x4;
47
48   /**
49    * The bit mask value <code>0x1</code> for a {@link #getSeverity severity} indicating that the diagnosis was canceled.
50    */

51   int CANCEL = 0x8;
52
53   /**
54    * Returns an indicator of the severity of the problem.
55    */

56   int getSeverity();
57
58   /**
59    * Returns a message describing the situation.
60    */

61   String JavaDoc getMessage();
62
63   /**
64    * Returns the unique identifier of the source.
65    */

66   String JavaDoc getSource();
67
68   /**
69    * Returns {@link #getSource source-specific} identity code.
70    */

71   int getCode();
72
73   /**
74    * Returns the arbitrary associated list of data.
75    * The first element is typically the object that is the primary source of the problem;
76    * the second element is typically some object describing the problematic feature or aspect of the primary source,
77    * and the remaining elements are additional objects associated with or describing the problem.
78    */

79   List JavaDoc getData();
80
81   /**
82    * Returns the list of child {@link Diagnostic diagnostics}.
83    */

84   List JavaDoc getChildren();
85
86   /**
87    * A diagnostic indicating that everything is okay.
88    */

89   Diagnostic OK_INSTANCE =
90     new BasicDiagnostic
91       (OK, "org.eclipse.emf.common", 0, org.eclipse.emf.common.CommonPlugin.INSTANCE.getString("_UI_OK_diagnostic_0"), null);
92
93   /**
94    * A diagnostic indicating that the diagnosis was canceled.
95    */

96   Diagnostic CANCEL_INSTANCE =
97     new BasicDiagnostic
98       (CANCEL, "org.eclipse.emf.common", 0, org.eclipse.emf.common.CommonPlugin.INSTANCE.getString("_UI_Cancel_diagnostic_0"), null);
99 }
100
Popular Tags