Java Doc for JavaDebugInterpreter.java in  » IDE » DrJava » edu » rice » cs » drjava » model » repl » 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 » DrJava » edu.rice.cs.drjava.model.repl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.rice.cs.drjava.model.repl.DynamicJavaAdapter
      edu.rice.cs.drjava.model.repl.JavaDebugInterpreter

JavaDebugInterpreter
public class JavaDebugInterpreter extends DynamicJavaAdapter (Code)
This class is an extension to DynamicJavaAdapter that allows us to process expressions involving the "this" keyword correctly in the current debug interpreter context. This allows users to debug outer classes and their fields using the usual Java syntax of outerclass.this. This is done by holding on to the class name of "this" and by translating references to outer instance classes to field accesses in the form "this.this$N.this$N-1...". This class is loaded in the Interpreter JVM, not the Main JVM. (Do not use DrJava's config framework here.)
version:
   $Id: JavaDebugInterpreter.java 4255 2007-08-28 19:17:37Z mgricken $


Field Summary
final protected  String_name
     This interpreter's name.
protected  String_thisClassName
     The class name of the "this" object for the currently suspended thread.
protected  String_thisPackageName
     The name of the package containing _this, if any.
protected  IdentityVisitor_translationVisitor
    

Constructor Summary
public  JavaDebugInterpreter(String name, String className)
     Creates a new debug interpreter.

Method Summary
protected  QualifiedName_convertThisToName(ThisExpression node)
     Helper method to convert a ThisExpression to a QualifiedName.
protected  Expression_convertThisToObjectFieldAccess(ThisExpression node)
     Helper method to convert a ThisExpression to a FieldAccess.
protected  ObjectFieldAccess_getObjectFieldAccessForField(String field, Context context)
     Given a field, looks at enclosing classes until it finds one that contains the field.
protected  ObjectMethodCall_getObjectMethodCallForFunction(MethodCall method, Context context)
     Given a method, looks at enclosing classes until it finds one that contains the method.
protected  ReferenceType_getReferenceTypeForField(String field, Context context)
     Given the name of an not fully qualified outer class, return the fully qualified ReferenceType that corresponds to that class.
protected  StaticFieldAccess_getStaticFieldAccessForField(String field, Context context)
     Given a field in a static context, looks at enclosing classes until it finds one that contains the field.
protected  StaticMethodCall_getStaticMethodCallForFunction(MethodCall method, Context context)
     Given a method in a static context, looks at enclosing classes until it finds one that contains the method.
protected  ThisExpressionbuildUnqualifiedThis()
     Builds a ThisExpression that has no class name.
public  GlobalContextmakeGlobalContext(TreeInterpreter i)
    
public  NameVisitormakeNameVisitor(Context nameContext)
     Factory method to make a new NameChecker that tries to find the right scope for QualifiedNames.
public  IdentityVisitormakeTranslationVisitor()
    
public  AbstractTypeCheckermakeTypeChecker(Context context)
     Factory method to make a new TypeChecker that treats "this" as a variable.
public  NodeprocessTree(Node node)
     Processes the tree before evaluating it.
protected  voidsetClassName(String className)
     Sets the class name of "this", parsing out the package name.
protected  intverifyClassName(String className)
     Checks if the className passed in is a valid className.
protected  ExpressionvisitThis(ThisExpression node)
     Converts the ThisExpression to a QualifiedName if it has no class name or an ObjectFieldAccess if it does.

Field Detail
_name
final protected String _name(Code)
This interpreter's name.



_thisClassName
protected String _thisClassName(Code)
The class name of the "this" object for the currently suspended thread.



_thisPackageName
protected String _thisPackageName(Code)
The name of the package containing _this, if any.



_translationVisitor
protected IdentityVisitor _translationVisitor(Code)
Extends IdentityVisitor to convert all instances of ThisExpressions in the tree to either QualifiedName or an ObjectFieldAccess




Constructor Detail
JavaDebugInterpreter
public JavaDebugInterpreter(String name, String className)(Code)
Creates a new debug interpreter.
Parameters:
  name - the name of the interpreter
Parameters:
  className - the class name of the current context of "this"




Method Detail
_convertThisToName
protected QualifiedName _convertThisToName(ThisExpression node)(Code)
Helper method to convert a ThisExpression to a QualifiedName. Allows us to redefine "this" in a debug interpreter.
Parameters:
  node - ThisExpression corresponding QualifiedName



_convertThisToObjectFieldAccess
protected Expression _convertThisToObjectFieldAccess(ThisExpression node)(Code)
Helper method to convert a ThisExpression to a FieldAccess. Allows us to access fields of outer classes in a debug interpreter.
Parameters:
  node - ThisExpression corresponding FieldAccess



_getObjectFieldAccessForField
protected ObjectFieldAccess _getObjectFieldAccessForField(String field, Context context)(Code)
Given a field, looks at enclosing classes until it finds one that contains the field. It returns the ObjectFieldAccess that represents the field.
Parameters:
  field - the name of the field
Parameters:
  context - the context the ObjectFieldAccess that represents the field or null if it cannot find the field in any enclosingclass.



_getObjectMethodCallForFunction
protected ObjectMethodCall _getObjectMethodCallForFunction(MethodCall method, Context context)(Code)
Given a method, looks at enclosing classes until it finds one that contains the method. It returns the ObjectMethodCall that represents the method.
Parameters:
  method - the method
Parameters:
  context - the context the ObjectMethodCall that represents the method or nullif it cannot find the method in any enclosing class.



_getReferenceTypeForField
protected ReferenceType _getReferenceTypeForField(String field, Context context)(Code)
Given the name of an not fully qualified outer class, return the fully qualified ReferenceType that corresponds to that class. This is called when the user references a static field of an outer class.
Parameters:
  field - the name of the not fully qualified outer class
Parameters:
  context - the context the ReferenceType that represents the field(in this case,really a class) or null if it cannot load the corresponding class in theclass loader.



_getStaticFieldAccessForField
protected StaticFieldAccess _getStaticFieldAccessForField(String field, Context context)(Code)
Given a field in a static context, looks at enclosing classes until it finds one that contains the field. It returns the StaticFieldAccess that represents the field.
Parameters:
  field - the name of the field
Parameters:
  context - the context the StaticFieldAccess that represents the field or nullif it cannot find the field in any enclosing class.



_getStaticMethodCallForFunction
protected StaticMethodCall _getStaticMethodCallForFunction(MethodCall method, Context context)(Code)
Given a method in a static context, looks at enclosing classes until it finds one that contains the method. It returns the StaticMethodCall that represents the method.
Parameters:
  method - the method
Parameters:
  context - the context the StaticMethodCall that represents the method or nullif it cannot find the method in any enclosing class.



buildUnqualifiedThis
protected ThisExpression buildUnqualifiedThis()(Code)
Builds a ThisExpression that has no class name. an unqualified ThisExpression



makeGlobalContext
public GlobalContext makeGlobalContext(TreeInterpreter i)(Code)



makeNameVisitor
public NameVisitor makeNameVisitor(Context nameContext)(Code)
Factory method to make a new NameChecker that tries to find the right scope for QualifiedNames.
Parameters:
  nameContext - Context for the NameVisitor the visitor



makeTranslationVisitor
public IdentityVisitor makeTranslationVisitor()(Code)
Makes an anonymous IdentityVisitor that overrides visit for a ThisExpresssion to convert it to either a QualifiedName or an ObjectFieldAccess



makeTypeChecker
public AbstractTypeChecker makeTypeChecker(Context context)(Code)
Factory method to make a new TypeChecker that treats "this" as a variable.
Parameters:
  context - the context visitor the visitor



processTree
public Node processTree(Node node)(Code)
Processes the tree before evaluating it. The translation visitor visits each node in the tree for the given statement or expression and converts the necessary nodes.
Parameters:
  node - Tree to process



setClassName
protected void setClassName(String className)(Code)
Sets the class name of "this", parsing out the package name.



verifyClassName
protected int verifyClassName(String className)(Code)
Checks if the className passed in is a valid className.
Parameters:
  className - the className of the ThisExpression the number of outer classes to walk out to



visitThis
protected Expression visitThis(ThisExpression node)(Code)
Converts the ThisExpression to a QualifiedName if it has no class name or an ObjectFieldAccess if it does.
Parameters:
  node - the expression to visit the converted form of the node



Fields inherited from edu.rice.cs.drjava.model.repl.DynamicJavaAdapter
ClassPathManager cpm(Code)(Java Doc)

Methods inherited from edu.rice.cs.drjava.model.repl.DynamicJavaAdapter
public void addBuildDirectoryClassPath(File path)(Code)(Java Doc)
public void addExternalFilesClassPath(File path)(Code)(Java Doc)
public void addExtraClassPath(File path)(Code)(Java Doc)
public void addProjectClassPath(File path)(Code)(Java Doc)
public void addProjectFilesClassPath(File path)(Code)(Java Doc)
public void defineConstant(String name, Object value)(Code)(Java Doc)
public void defineConstant(String name, boolean value)(Code)(Java Doc)
public void defineConstant(String name, byte value)(Code)(Java Doc)
public void defineConstant(String name, char value)(Code)(Java Doc)
public void defineConstant(String name, double value)(Code)(Java Doc)
public void defineConstant(String name, float value)(Code)(Java Doc)
public void defineConstant(String name, int value)(Code)(Java Doc)
public void defineConstant(String name, long value)(Code)(Java Doc)
public void defineConstant(String name, short value)(Code)(Java Doc)
public void defineVariable(String name, Object value, Class type)(Code)(Java Doc)
public void defineVariable(String name, Object value)(Code)(Java Doc)
public void defineVariable(String name, boolean value)(Code)(Java Doc)
public void defineVariable(String name, byte value)(Code)(Java Doc)
public void defineVariable(String name, char value)(Code)(Java Doc)
public void defineVariable(String name, double value)(Code)(Java Doc)
public void defineVariable(String name, float value)(Code)(Java Doc)
public void defineVariable(String name, int value)(Code)(Java Doc)
public void defineVariable(String name, long value)(Code)(Java Doc)
public void defineVariable(String name, short value)(Code)(Java Doc)
public boolean getPrivateAccessible()(Code)(Java Doc)
public Object getVariable(String name)(Code)(Java Doc)
public Class getVariableClass(String name)(Code)(Java Doc)
public Object interpret(String s) throws ExceptionReturnedException(Code)(Java Doc)
public EvaluationVisitor makeEvaluationVisitor(Context context)(Code)(Java Doc)
public GlobalContext makeGlobalContext(TreeInterpreter i)(Code)(Java Doc)
public NameVisitor makeNameVisitor(Context nameContext)(Code)(Java Doc)
public List<Node> parse(String input)(Code)(Java Doc)
public Node processTree(Node node)(Code)(Java Doc)
public void setPackageScope(String packageName)(Code)(Java Doc)
public void setPrivateAccessible(boolean accessible)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.