Java Doc for Reflection.java in  » Byte-Code » Javassist » javassist » tools » reflect » 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 » Byte Code » Javassist » javassist.tools.reflect 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javassist.tools.reflect.Reflection

Reflection
public class Reflection implements Translator(Code)
The class implementing the behavioral reflection mechanism.

If a class is reflective, then all the method invocations on every instance of that class are intercepted by the runtime metaobject controlling that instance. The methods inherited from the super classes are also intercepted except final methods. To intercept a final method in a super class, that super class must be also reflective.

To do this, the original class file representing a reflective class:

     class Person {
     public int f(int i) { return i + 1; }
     public int value;
     }
     

is modified so that it represents a class:

     class Person implements Metalevel {
     public int _original_f(int i) { return i + 1; }
     public int f(int i) { delegate to the metaobject }
     public int value;
     public int _r_value() { read "value" }
     public void _w_value(int v) { write "value" }
     public ClassMetaobject _getClass() { return a class metaobject }
     public Metaobject _getMetaobject() { return a metaobject }
     public void _setMetaobject(Metaobject m) { change a metaobject }
     }
     

See Also:   javassist.tools.reflect.ClassMetaobject
See Also:   javassist.tools.reflect.Metaobject
See Also:   javassist.tools.reflect.Loader
See Also:   javassist.tools.reflect.Compiler


Field Summary
final static  StringclassMetaobjectClassName
    
protected  ClassPoolclassPool
    
final static  StringclassobjectAccessor
    
final static  StringclassobjectField
    
protected  CodeConverterconverter
    
final static  StringmetaobjectClassName
    
final static  StringmetaobjectField
    
final static  StringmetaobjectGetter
    
final static  StringmetaobjectSetter
    
protected  CtClass[]readParam
    
final static  StringreadPrefix
    
protected  CtMethodtrapMethodtrapStaticMethod
    
protected  CtMethodtrapReadtrapWrite
    
final static  StringwritePrefix
    

Constructor Summary
public  Reflection()
     Constructs a new Reflection object.

Method Summary
public  booleanmakeReflective(String classname, String metaobject, String metaclass)
     Produces a reflective class. If the super class is also made reflective, it must be done before the sub class.
Parameters:
  classname - the name of the reflective class
Parameters:
  metaobject - the class name of metaobjects.
Parameters:
  metaclass - the class name of the class metaobject.
public  booleanmakeReflective(Class clazz, Class metaobject, Class metaclass)
     Produces a reflective class. If the super class is also made reflective, it must be done before the sub class.
Parameters:
  clazz - the reflective class.
Parameters:
  metaobject - the class of metaobjects.It must be a subclass ofMetaobject.
Parameters:
  metaclass - the class of the class metaobject.It must be a subclass ofClassMetaobject.
public  booleanmakeReflective(CtClass clazz, CtClass metaobject, CtClass metaclass)
     Produces a reflective class.
public  voidonLoad(ClassPool pool, String classname)
     Inserts hooks for intercepting accesses to the fields declared in reflective classes.
public  voidstart(ClassPool pool)
     Initializes the object.

Field Detail
classMetaobjectClassName
final static String classMetaobjectClassName(Code)



classPool
protected ClassPool classPool(Code)



classobjectAccessor
final static String classobjectAccessor(Code)



classobjectField
final static String classobjectField(Code)



converter
protected CodeConverter converter(Code)



metaobjectClassName
final static String metaobjectClassName(Code)



metaobjectField
final static String metaobjectField(Code)



metaobjectGetter
final static String metaobjectGetter(Code)



metaobjectSetter
final static String metaobjectSetter(Code)



readParam
protected CtClass[] readParam(Code)



readPrefix
final static String readPrefix(Code)



trapMethodtrapStaticMethod
protected CtMethod trapMethodtrapStaticMethod(Code)



trapReadtrapWrite
protected CtMethod trapReadtrapWrite(Code)



writePrefix
final static String writePrefix(Code)




Constructor Detail
Reflection
public Reflection()(Code)
Constructs a new Reflection object.




Method Detail
makeReflective
public boolean makeReflective(String classname, String metaobject, String metaclass) throws CannotCompileException, NotFoundException(Code)
Produces a reflective class. If the super class is also made reflective, it must be done before the sub class.
Parameters:
  classname - the name of the reflective class
Parameters:
  metaobject - the class name of metaobjects.
Parameters:
  metaclass - the class name of the class metaobject. false if the class is already reflective.
See Also:   javassist.tools.reflect.Metaobject
See Also:   javassist.tools.reflect.ClassMetaobject



makeReflective
public boolean makeReflective(Class clazz, Class metaobject, Class metaclass) throws CannotCompileException, NotFoundException(Code)
Produces a reflective class. If the super class is also made reflective, it must be done before the sub class.
Parameters:
  clazz - the reflective class.
Parameters:
  metaobject - the class of metaobjects.It must be a subclass ofMetaobject.
Parameters:
  metaclass - the class of the class metaobject.It must be a subclass ofClassMetaobject. false if the class is already reflective.
See Also:   javassist.tools.reflect.Metaobject
See Also:   javassist.tools.reflect.ClassMetaobject



makeReflective
public boolean makeReflective(CtClass clazz, CtClass metaobject, CtClass metaclass) throws CannotCompileException, CannotReflectException, NotFoundException(Code)
Produces a reflective class. It modifies the given CtClass object and makes it reflective. If the super class is also made reflective, it must be done before the sub class.
Parameters:
  clazz - the reflective class.
Parameters:
  metaobject - the class of metaobjects.It must be a subclass ofMetaobject.
Parameters:
  metaclass - the class of the class metaobject.It must be a subclass ofClassMetaobject. false if the class is already reflective.
See Also:   javassist.tools.reflect.Metaobject
See Also:   javassist.tools.reflect.ClassMetaobject



onLoad
public void onLoad(ClassPool pool, String classname) throws CannotCompileException, NotFoundException(Code)
Inserts hooks for intercepting accesses to the fields declared in reflective classes.



start
public void start(ClassPool pool) throws NotFoundException(Code)
Initializes the object.



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.