Source Code Cross Referenced for EvaluationResult.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » internal » debug » eval » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jdt » org.eclipse.jdt.internal.debug.eval 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.internal.debug.eval;
011:
012:        import java.util.ArrayList;
013:        import java.util.Iterator;
014:        import java.util.List;
015:
016:        import org.eclipse.debug.core.DebugException;
017:        import org.eclipse.jdt.core.dom.Message;
018:        import org.eclipse.jdt.debug.core.IJavaThread;
019:        import org.eclipse.jdt.debug.core.IJavaValue;
020:        import org.eclipse.jdt.debug.eval.IEvaluationEngine;
021:        import org.eclipse.jdt.debug.eval.IEvaluationResult;
022:
023:        /**
024:         * The result of an evaluation.
025:         * 
026:         * @see org.eclipse.jdt.debug.eval.IEvaluationResult
027:         */
028:        public class EvaluationResult implements  IEvaluationResult {
029:
030:            /**
031:             * The result of an evaluation, possibly <code>null</code>
032:             */
033:            private IJavaValue fValue;
034:
035:            /**
036:             * Thread in which the associated evaluation was
037:             * executed.
038:             */
039:            private IJavaThread fThread;
040:
041:            /**
042:             * Evaluation engine that created this result
043:             */
044:            private IEvaluationEngine fEngine;
045:
046:            /**
047:             * Source that was evaluated.
048:             */
049:            private String fSnippet;
050:
051:            /**
052:             * Exception that occurred during evaluation,
053:             * or <code>null</code> if none.
054:             */
055:            private DebugException fException;
056:
057:            /**
058:             * List of <code>String</code>s describing compilation problems.
059:             */
060:            private List fErrors;
061:
062:            /**
063:             * Constructs a new evaluation result for the given
064:             * engine, thread, and code snippet.
065:             */
066:            public EvaluationResult(IEvaluationEngine engine, String snippet,
067:                    IJavaThread thread) {
068:                setEvaluationEngine(engine);
069:                setThread(thread);
070:                setSnippet(snippet);
071:                fErrors = new ArrayList();
072:            }
073:
074:            /**
075:             * @see IEvaluationResult#getValue()
076:             */
077:            public IJavaValue getValue() {
078:                return fValue;
079:            }
080:
081:            /**
082:             * Sets the result of an evaluation, possibly
083:             * <code>null</code>.
084:             * 
085:             * @param value result of an evaluation, possibly
086:             * 	<code>null</code>
087:             */
088:            public void setValue(IJavaValue value) {
089:                fValue = value;
090:            }
091:
092:            /**
093:             * @see IEvaluationResult#hasProblems()
094:             */
095:            public boolean hasErrors() {
096:                return getErrors().length > 0 || getException() != null;
097:            }
098:
099:            /**
100:             * @see IEvaluationResult#getProblems()
101:             * @deprecated
102:             */
103:            public Message[] getErrors() {
104:                Message[] messages = new Message[fErrors.size()];
105:                int i = 0;
106:                for (Iterator iter = fErrors.iterator(); iter.hasNext();) {
107:                    messages[i++] = new Message((String) iter.next(), -1);
108:                }
109:                return messages;
110:            }
111:
112:            /**
113:             * @see org.eclipse.jdt.debug.eval.IEvaluationResult#getErrorMessages()
114:             */
115:            public String[] getErrorMessages() {
116:                return (String[]) fErrors.toArray(new String[fErrors.size()]);
117:            }
118:
119:            /**
120:             * @see IEvaluationResult#getSnippet()
121:             */
122:            public String getSnippet() {
123:                return fSnippet;
124:            }
125:
126:            /**
127:             * Sets the code snippet that was evaluated.
128:             * 
129:             * @param snippet the source code that was evaluated
130:             */
131:            private void setSnippet(String snippet) {
132:                fSnippet = snippet;
133:            }
134:
135:            /**
136:             * @see IEvaluationResult#getException()
137:             */
138:            public DebugException getException() {
139:                return fException;
140:            }
141:
142:            /**
143:             * Sets an exception that occurred while attempting
144:             * the associated evaluation.
145:             * 
146:             * @param e exception
147:             */
148:            public void setException(DebugException e) {
149:                fException = e;
150:            }
151:
152:            /**
153:             * @see IEvaluationResult#getThread()
154:             */
155:            public IJavaThread getThread() {
156:                return fThread;
157:            }
158:
159:            /**
160:             * Sets the thread this result was generated
161:             * from.
162:             * 
163:             * @param thread thread in which the associated
164:             *   evaluation was executed
165:             */
166:            private void setThread(IJavaThread thread) {
167:                fThread = thread;
168:            }
169:
170:            /**
171:             * @see IEvaluationResult#getEvaluationEngine()
172:             */
173:            public IEvaluationEngine getEvaluationEngine() {
174:                return fEngine;
175:            }
176:
177:            /**
178:             * Sets the evaluation that created this result.
179:             * 
180:             * @param engine the evaluation that created this result
181:             */
182:            private void setEvaluationEngine(IEvaluationEngine engine) {
183:                fEngine = engine;
184:            }
185:
186:            /**
187:             * Adds the given message to the list of error messages.
188:             */
189:            public void addError(String message) {
190:                fErrors.add(message);
191:            }
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.