comparison org.eclipse.equinox.common/src/org/eclipse/core/runtime/IStatus.d @ 105:bbe49769ec18

...
author Frank Benoit <benoit@tionex.de>
date Sun, 08 Nov 2009 12:42:30 +0100
parents bc29606a740c
children
comparison
equal deleted inserted replaced
104:88652073d1c2 105:bbe49769ec18
2 * Copyright (c) 2000, 2006 IBM Corporation and others. 2 * Copyright (c) 2000, 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 10 *******************************************************************************/
13 module org.eclipse.core.runtime.IStatus; 11 // Port to the D programming language:
12 // Frank Benoit <benoit@tionex.de>
13 module org.eclipse.core.runtimeIStatus;
14 14
15 import java.lang.all; 15 import java.lang.all;
16 16
17 import org.eclipse.core.runtimeStatus; // packageimport
18
17 /** 19 /**
18 * A status object represents the outcome of an operation. 20 * A status object represents the outcome of an operation.
19 * All <code>CoreException</code>s carry a status object to indicate 21 * All <code>CoreException</code>s carry a status object to indicate
20 * what went wrong. Status objects are also returned by methods needing 22 * what went wrong. Status objects are also returned by methods needing
21 * to provide details of failures (e.g., validation methods). 23 * to provide details of failures (e.g., validation methods).
22 * <p> 24 * <p>
23 * A status carries the following information: 25 * A status carries the following information:
24 * <ul> 26 * <ul>
25 * <li> plug-in identifier (required)</li> 27 * <li> plug-in identifier (required)</li>
27 * <li> status code (required)</li> 29 * <li> status code (required)</li>
28 * <li> message (required) - localized to current locale</li> 30 * <li> message (required) - localized to current locale</li>
29 * <li> exception (optional) - for problems stemming from a failure at 31 * <li> exception (optional) - for problems stemming from a failure at
30 * a lower level</li> 32 * a lower level</li>
31 * </ul> 33 * </ul>
32 * Some status objects, known as multi-statuses, have other status objects 34 * Some status objects, known as multi-statuses, have other status objects
33 * as children. 35 * as children.
34 * </p> 36 * </p>
35 * <p> 37 * <p>
36 * The class <code>Status</code> is the standard public implementation 38 * The class <code>Status</code> is the standard public implementation
37 * of status objects; the subclass <code>MultiStatus</code> is the 39 * of status objects; the subclass <code>MultiStatus</code> is the
47 /** Status severity constant (value 0) indicating this status represents the nominal case. 49 /** Status severity constant (value 0) indicating this status represents the nominal case.
48 * This constant is also used as the status code representing the nominal case. 50 * This constant is also used as the status code representing the nominal case.
49 * @see #getSeverity() 51 * @see #getSeverity()
50 * @see #isOK() 52 * @see #isOK()
51 */ 53 */
52 public static const int OK = 0; 54 public static final int OK = 0;
53 55
54 /** Status type severity (bit mask, value 1) indicating this status is informational only. 56 /** Status type severity (bit mask, value 1) indicating this status is informational only.
55 * @see #getSeverity() 57 * @see #getSeverity()
56 * @see #matches(int) 58 * @see #matches(int)
57 */ 59 */
58 public static const int INFO = 0x01; 60 public static final int INFO = 0x01;
59 61
60 /** Status type severity (bit mask, value 2) indicating this status represents a warning. 62 /** Status type severity (bit mask, value 2) indicating this status represents a warning.
61 * @see #getSeverity() 63 * @see #getSeverity()
62 * @see #matches(int) 64 * @see #matches(int)
63 */ 65 */
64 public static const int WARNING = 0x02; 66 public static final int WARNING = 0x02;
65 67
66 /** Status type severity (bit mask, value 4) indicating this status represents an error. 68 /** Status type severity (bit mask, value 4) indicating this status represents an error.
67 * @see #getSeverity() 69 * @see #getSeverity()
68 * @see #matches(int) 70 * @see #matches(int)
69 */ 71 */
70 public static const int ERROR = 0x04; 72 public static final int ERROR = 0x04;
71 73
72 /** Status type severity (bit mask, value 8) indicating this status represents a 74 /** Status type severity (bit mask, value 8) indicating this status represents a
73 * cancelation 75 * cancelation
74 * @see #getSeverity() 76 * @see #getSeverity()
75 * @see #matches(int) 77 * @see #matches(int)
76 * @since 3.0 78 * @since 3.0
77 */ 79 */
78 public static const int CANCEL = 0x08; 80 public static final int CANCEL = 0x08;
79 81
80 /** 82 /**
81 * Returns a list of status object immediately contained in this 83 * Returns a list of status object immediately contained in this
82 * multi-status, or an empty list if this is not a multi-status. 84 * multi-status, or an empty list if this is not a multi-status.
83 * 85 *
92 * @return plug-in-specific status code 94 * @return plug-in-specific status code
93 */ 95 */
94 public int getCode(); 96 public int getCode();
95 97
96 /** 98 /**
97 * Returns the relevant low-level exception, or <code>null</code> if none. 99 * Returns the relevant low-level exception, or <code>null</code> if none.
98 * For example, when an operation fails because of a network communications 100 * For example, when an operation fails because of a network communications
99 * failure, this might return the <code>java.io.IOException</code> 101 * failure, this might return the <code>java.io.IOException</code>
100 * describing the exact nature of that failure. 102 * describing the exact nature of that failure.
101 * 103 *
102 * @return the relevant low-level exception, or <code>null</code> if none 104 * @return the relevant low-level exception, or <code>null</code> if none
103 */ 105 */
104 public Exception getException(); 106 public Throwable getException();
105 107
106 /** 108 /**
107 * Returns the message describing the outcome. 109 * Returns the message describing the outcome.
108 * The message is localized to the current locale. 110 * The message is localized to the current locale.
109 * 111 *
133 * The severity of a multi-status is defined to be the maximum 135 * The severity of a multi-status is defined to be the maximum
134 * severity of any of its children, or <code>OK</code> if it has 136 * severity of any of its children, or <code>OK</code> if it has
135 * no children. 137 * no children.
136 * </p> 138 * </p>
137 * 139 *
138 * @return the severity: one of <code>OK</code>, <code>ERROR</code>, 140 * @return the severity: one of <code>OK</code>, <code>ERROR</code>,
139 * <code>INFO</code>, <code>WARNING</code>, or <code>CANCEL</code> 141 * <code>INFO</code>, <code>WARNING</code>, or <code>CANCEL</code>
140 * @see #matches(int) 142 * @see #matches(int)
141 */ 143 */
142 public int getSeverity(); 144 public int getSeverity();
143 145
152 * A multi-status carries a plug-in identifier, a status code, 154 * A multi-status carries a plug-in identifier, a status code,
153 * a message, and an optional exception. Clients may treat 155 * a message, and an optional exception. Clients may treat
154 * multi-status objects in a multi-status unaware way. 156 * multi-status objects in a multi-status unaware way.
155 * </p> 157 * </p>
156 * 158 *
157 * @return <code>true</code> for a multi-status, 159 * @return <code>true</code> for a multi-status,
158 * <code>false</code> otherwise 160 * <code>false</code> otherwise
159 * @see #getChildren() 161 * @see #getChildren()
160 */ 162 */
161 public bool isMultiStatus(); 163 public bool isMultiStatus();
162 164
176 * a status with a severity of <code>OK</code>. 178 * a status with a severity of <code>OK</code>.
177 * 179 *
178 * @param severityMask a mask formed by bitwise or'ing severity mask 180 * @param severityMask a mask formed by bitwise or'ing severity mask
179 * constants (<code>ERROR</code>, <code>WARNING</code>, 181 * constants (<code>ERROR</code>, <code>WARNING</code>,
180 * <code>INFO</code>, <code>CANCEL</code>) 182 * <code>INFO</code>, <code>CANCEL</code>)
181 * @return <code>true</code> if there is at least one match, 183 * @return <code>true</code> if there is at least one match,
182 * <code>false</code> if there are no matches 184 * <code>false</code> if there are no matches
183 * @see #getSeverity() 185 * @see #getSeverity()
184 * @see #CANCEL 186 * @see #CANCEL
185 * @see #ERROR 187 * @see #ERROR
186 * @see #WARNING 188 * @see #WARNING