Java Doc for This.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » bsh » 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 » Swing Library » jEdit » org.gjt.sp.jedit.bsh 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.gjt.sp.jedit.bsh.This

All known Subclasses:   org.gjt.sp.jedit.bsh.XThis,  org.gjt.sp.jedit.bsh.JThis,
This
public class This implements java.io.Serializable,Runnable(Code)
'This' is the type of bsh scripted objects. A 'This' object is a bsh scripted object context. It holds a namespace reference and implements event listeners and various other interfaces. This holds a reference to the declaring interpreter for callbacks from outside of bsh.


Field Summary
transient  InterpreterdeclaringInterpreter
     This is the interpreter running when the This ref was created. It's used as a default interpreter for callback through the This where there is no current interpreter instance e.g.
 NameSpacenamespace
     The namespace that this This reference wraps.

Constructor Summary
protected  This(NameSpace namespace, Interpreter declaringInterpreter)
    

Method Summary
public static  voidbind(This ths, NameSpace namespace, Interpreter declaringInterpreter)
     Bind a This reference to a parent's namespace with the specified declaring interpreter.
public  ObjectgetInterface(Class clas)
     Get a version of this scripted object implementing the specified interface.
public  ObjectgetInterface(Class[] ca)
     Get a version of this scripted object implementing the specified interfaces.
public  NameSpacegetNameSpace()
    
static  ThisgetThis(NameSpace namespace, Interpreter declaringInterpreter)
     getThis() is a factory for bsh.This type references.
public  ObjectinvokeMethod(String name, Object[] args)
     Invoke specified method as from outside java code, using the declaring interpreter and current namespace.
public  ObjectinvokeMethod(String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly)
     Invoke a method in this namespace with the specified args, interpreter reference, callstack, and caller info.

Note: If you use this method outside of the bsh package and wish to use variables with primitive values you will have to wrap them using bsh.Primitive.

static  booleanisExposedThisMethod(String name)
     Allow invocations of these method names on This type objects. Don't give bsh.This a chance to override their behavior.

If the method is passed here the invocation will actually happen on the bsh.This object via the regular reflective method invocation mechanism.

public  voidrun()
    
public  StringtoString()
    

Field Detail
declaringInterpreter
transient Interpreter declaringInterpreter(Code)
This is the interpreter running when the This ref was created. It's used as a default interpreter for callback through the This where there is no current interpreter instance e.g. interface proxy or event call backs from outside of bsh.



namespace
NameSpace namespace(Code)
The namespace that this This reference wraps.




Constructor Detail
This
protected This(NameSpace namespace, Interpreter declaringInterpreter)(Code)




Method Detail
bind
public static void bind(This ths, NameSpace namespace, Interpreter declaringInterpreter)(Code)
Bind a This reference to a parent's namespace with the specified declaring interpreter. Also re-init the callstack. It's necessary to bind a This reference before it can be used after deserialization. This is used by the bsh load() command.

This is a static utility method because it's used by a bsh command bind() and the interpreter doesn't currently allow access to direct methods of This objects (small hack)




getInterface
public Object getInterface(Class clas) throws UtilEvalError(Code)
Get a version of this scripted object implementing the specified interface.



getInterface
public Object getInterface(Class[] ca) throws UtilEvalError(Code)
Get a version of this scripted object implementing the specified interfaces.



getNameSpace
public NameSpace getNameSpace()(Code)



getThis
static This getThis(NameSpace namespace, Interpreter declaringInterpreter)(Code)
getThis() is a factory for bsh.This type references. The capabilities of ".this" references in bsh are version dependent up until jdk1.3. The version dependence was to support different default interface implementations. i.e. different sets of listener interfaces which scripted objects were capable of implementing. In jdk1.3 the reflection proxy mechanism was introduced which allowed us to implement arbitrary interfaces. This is fantastic. A This object is a thin layer over a namespace, comprising a bsh object context. We create it here only if needed for the namespace. Note: this method could be considered slow because of the way it dynamically factories objects. However I've also done tests where I hard-code the factory to return JThis and see no change in the rough test suite time. This references are also cached in NameSpace.



invokeMethod
public Object invokeMethod(String name, Object[] args) throws EvalError(Code)
Invoke specified method as from outside java code, using the declaring interpreter and current namespace. The call stack will indicate that the method is being invoked from outside of bsh in native java code. Note: you must still wrap/unwrap args/return values using Primitive/Primitive.unwrap() for use outside of BeanShell.
See Also:   org.gjt.sp.jedit.bsh.Primitive



invokeMethod
public Object invokeMethod(String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo, boolean declaredOnly) throws EvalError(Code)
Invoke a method in this namespace with the specified args, interpreter reference, callstack, and caller info.

Note: If you use this method outside of the bsh package and wish to use variables with primitive values you will have to wrap them using bsh.Primitive. Consider using This getInterface() to make a true Java interface for invoking your scripted methods.

This method also implements the default object protocol of toString(), hashCode() and equals() and the invoke() meta-method handling as a last resort.

Note: The invoke() meta-method will not catch the Object protocol methods (toString(), hashCode()...). If you want to override them you have to script them directly.


See Also:    org.gjt.sp.jedit.bsh.This.invokeMethod(
See Also:   String methodName, Object [] args, Interpreter interpreter,
See Also:   CallStack callstack, SimpleNode callerInfo ) if callStack is null a new CallStack will be created andinitialized with this namespace.
Parameters:
  declaredOnly - if true then only methods declared directly in thenamespace will be visible - no inherited or imported methods willbe visible.
See Also:   org.gjt.sp.jedit.bsh.Primitive




isExposedThisMethod
static boolean isExposedThisMethod(String name)(Code)
Allow invocations of these method names on This type objects. Don't give bsh.This a chance to override their behavior.

If the method is passed here the invocation will actually happen on the bsh.This object via the regular reflective method invocation mechanism. If not, then the method is evaluated by bsh.This itself as a scripted method call.




run
public void run()(Code)



toString
public String toString()(Code)



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.