Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 374d04886dcf39a235b94fec92dfc628759928df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.core.model;

import org.eclipse.debug.core.DebugException;

/**
 * The result of an evaluation performed by an
 * <code>org.eclipse.debug.core.model.IWatchExpressionDelegate</code>.
 * A watch expression reports the value of the evaluation
 * and any errors or exceptions that occurred.
 * <p>
 * Clients may implement this interface.
 * </p>
 * @see org.eclipse.debug.core.model.IWatchExpressionDelegate
 * @since 3.0
 */
public interface IWatchExpressionResult {
	/**
	 * Returns the value representing the result of the
	 * evaluation, or <code>null</code> if the
	 * associated evaluation failed. If
	 * the associated evaluation failed, there will
	 * be problems, or an exception in this result.
	 *
	 * @return the resulting value, possibly
	 * <code>null</code>
	 */
	IValue getValue();

	/**
	 * Returns whether the evaluation had any problems
	 * or if an exception occurred while performing the
	 * evaluation.
	 *
	 * @return whether there were any problems.
	 * @see #getErrorMessages()
	 * @see #getException()
	 */
	boolean hasErrors();

	/**
	 * Returns an array of problem messages. Each message describes a problem that
	 * occurred while compiling the snippet.
	 *
	 * @return evaluation error messages, or an empty array if no errors occurred
	 */
	String[] getErrorMessages();

	/**
	 * Returns the expression that was evaluated.
	 *
	 * @return The string expression.
	 */
	String getExpressionText();

	/**
	 * Returns any exception that occurred while performing the evaluation
	 * or <code>null</code> if an exception did not occur.
	 * The exception will be a debug exception or a debug exception
	 * that wrappers a debug model specific exception that indicates a problem communicating
	 * with the target or with actually performing some action in the target.
	 *
	 * @return The exception that occurred during the evaluation
	 * @see org.eclipse.debug.core.DebugException
	 */
	DebugException getException();
}

Back to the top