Java Doc for ClassWrapGen.java in  » Scripting » oscript-2.10.4 » oscript » classwrap » 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 » Scripting » oscript 2.10.4 » oscript.classwrap 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   oscript.classwrap.ClassWrapGen

ClassWrapGen
public class ClassWrapGen (Code)
The classwrap package is used to generate a "wrapper" for a java class. A wrapper is just a subclass of a given java class, where for each public non-final, non-static method, a wrapper method and an "orig" method are generated. The wrapper method looks up a property with the same name in the script object, and if it exists, and is a function that takes a compatible number of arguments, calls it, otherwise it calls the same method in the parent (original) java class. The orig method simply calls the same method in the parent class.

The "wrapper" class is used any place where a script objects extends a java class (ie. java class, java interface, or builtin-type). The purpose is to allow the script object to override methods in a java class, or implement methods in a java interface.

The "wrapper" class is generated using the Byte Code Engineering Library (BCEL.jar).
author:
   Rob Clark (rob@ti.com)
author:
  
version:
   1.34





Method Summary
public static  booleancanMakeWrapperClass(Class origClass)
     Check if we can make a wrapper class for the specified class...
final public static  ClassgetNonWrapperClass(Class javaClass)
     Given a java class that may or may not be a wrapper class, return a java class that is the closest super-class that is not a wrapper class.
public static  StringgetOrigMethodName(Object javaObj, String methodName)
     Because the wrapper method looks to the script object first, before calling the wrapped method, there are times when we want to call the original method directly.
public static  StringgetOrigMethodName(String methodName)
    
public static  ValuegetScriptObject(Object javaObj)
     Given a java object, which may be linked to a script object, return the linked script object.
public static  booleanisWrapperInstance(Object javaObj)
    
public static  voidlinkObjects(Object javaObj, Scope scriptObj)
     Link the specified java object and script object.
public static synchronized  ClassmakeWrapperClass(Class origClass)
     Make the wrapper class.



Method Detail
canMakeWrapperClass
public static boolean canMakeWrapperClass(Class origClass)(Code)
Check if we can make a wrapper class for the specified class... this is needed by JavaClassWrapper, which needs to know if it can construct a wrapper class... but it wants to defer the act of actually making the wrapper class.
Parameters:
  origClass - the original class true if we can make a wrapper (ie. class isn'tfinal, etc)



getNonWrapperClass
final public static Class getNonWrapperClass(Class javaClass)(Code)
Given a java class that may or may not be a wrapper class, return a java class that is the closest super-class that is not a wrapper class.
Parameters:
  javaClass - a java class that might be a wrapper class a java class that is not a wrapper class



getOrigMethodName
public static String getOrigMethodName(Object javaObj, String methodName)(Code)
Because the wrapper method looks to the script object first, before calling the wrapped method, there are times when we want to call the original method directly. To do this, you call the "orig" method. To hide the naming convention, other code should use this method to get the name of the "orig" method for the named method.
Parameters:
  javaObj - the java object
Parameters:
  methodName - the name of the method in the parent class the mangled name of the method that calls the requestedmethod in the parent class, ie. the "orig" method.



getOrigMethodName
public static String getOrigMethodName(String methodName)(Code)



getScriptObject
public static Value getScriptObject(Object javaObj)(Code)
Given a java object, which may be linked to a script object, return the linked script object.
Parameters:
  javaObj - the java object the script object, or null



isWrapperInstance
public static boolean isWrapperInstance(Object javaObj)(Code)
Is the specified object an instance of a wrapper class?
Parameters:
  javaObj - the java object to test true if instance of auto-generated wrapper class



linkObjects
public static void linkObjects(Object javaObj, Scope scriptObj)(Code)
Link the specified java object and script object. The java object should be an instance of a wrapper class generated by the makeWrapperClass method.
Parameters:
  javaObj - the java object
Parameters:
  scriptObj - the script object



makeWrapperClass
public static synchronized Class makeWrapperClass(Class origClass)(Code)
Make the wrapper class. Wrap all public non-final instance methods.
Parameters:
  origClass - the original class the auto-generated wrapper class, or if a wrapper class cannotbe generated, the origClass. This should never returnnull.



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.