001: /*******************************************************************************
002: * Copyright (c) 2000, 2005 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.debug.eval;
011:
012: import org.eclipse.debug.core.DebugException;
013: import org.eclipse.jdt.core.dom.Message;
014: import org.eclipse.jdt.debug.core.IJavaThread;
015: import org.eclipse.jdt.debug.core.IJavaValue;
016:
017: /**
018: * The result of an evaluation. An evaluation result may
019: * contain problems and/or a result value.
020: * <p>
021: * Clients are not intended to implement this interface.
022: * </p>
023: * @see IJavaValue
024: * @since 2.0
025: */
026:
027: public interface IEvaluationResult {
028:
029: /**
030: * Returns the value representing the result of the
031: * evaluation, or <code>null</code> if the
032: * associated evaluation failed. If
033: * the associated evaluation failed, there will
034: * be problems, or an exception in this result.
035: *
036: * @return the resulting value, possibly
037: * <code>null</code>
038: */
039: public IJavaValue getValue();
040:
041: /**
042: * Returns whether the evaluation had any problems
043: * or if an exception occurred while performing the
044: * evaluation.
045: *
046: * @return whether there were any problems.
047: * @see #getErrors()
048: * @see #getException()
049: */
050: public boolean hasErrors();
051:
052: /**
053: * Returns an array of problem messages. Each message describes a problem that
054: * occurred while compiling the snippet.
055: *
056: * @return compilation error messages, or an empty array if no errors occurred
057: * @deprecated use getErrorMessages()
058: */
059: public Message[] getErrors();
060:
061: /**
062: * Returns an array of problem messages. Each message describes a problem that
063: * occurred while compiling the snippet.
064: *
065: * @return compilation error messages, or an empty array if no errors occurred
066: * @since 2.1
067: */
068: public String[] getErrorMessages();
069:
070: /**
071: * Returns the snippet that was evaluated.
072: *
073: * @return The string code snippet.
074: */
075: public String getSnippet();
076:
077: /**
078: * Returns any exception that occurred while performing the evaluation
079: * or <code>null</code> if an exception did not occur.
080: * The exception will be a debug exception or a debug exception
081: * that wrappers a JDI exception that indicates a problem communicating
082: * with the target or with actually performing some action in the target.
083: *
084: * @return The exception that occurred during the evaluation
085: * @see com.sun.jdi.InvocationException
086: * @see org.eclipse.debug.core.DebugException
087: */
088: public DebugException getException();
089:
090: /**
091: * Returns the thread in which the evaluation was performed.
092: *
093: * @return the thread in which the evaluation was performed
094: */
095: public IJavaThread getThread();
096:
097: /**
098: * Returns the evaluation engine used to evaluate the original
099: * snippet.
100: *
101: * @return the evaluation engine used to evaluate the
102: * original snippet
103: */
104: public IEvaluationEngine getEvaluationEngine();
105: }
|