Java Doc for ClassMetaobject.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.ClassMetaobject

ClassMetaobject
public class ClassMetaobject implements Serializable(Code)
A runtime class metaobject.

A ClassMetaobject is created for every class of reflective objects. It can be used to hold values shared among the reflective objects of the same class.

To obtain a class metaobject, calls _getClass() on a reflective object. For example,

    ClassMetaobject cm = ((Metalevel)reflectiveObject)._getClass();
     

See Also:   javassist.tools.reflect.Metaobject
See Also:   javassist.tools.reflect.Metalevel


Field Summary
final static  StringmethodPrefix
     The base-level methods controlled by a metaobject are renamed so that they begin with methodPrefix "_m_".
final static  intmethodPrefixLen
    
public static  booleanuseContextClassLoader
     Specifies how a java.lang.Class object is loaded.

Constructor Summary
public  ClassMetaobject(String[] params)
     Constructs a ClassMetaobject.

Method Summary
final public  ClassgetJavaClass()
     Obtains the java.lang.Class representing this class.
final public  MethodgetMethod(int identifier)
     Returns the java.lang.reflect.Method object representing the method specified by identifier.

Note that the actual method returned will be have an altered, reflective name i.e.

final public  intgetMethodIndex(String originalName, Class[] argTypes)
     Returns the identifier index of the method, as identified by its original name.

This method is useful, in conjuction with ClassMetaobject#getMethod(), to obtain a quick reference to the original method in the reflected class (i.e.

final public  StringgetMethodName(int identifier)
     Returns the name of the method specified by identifier.
final public  StringgetName()
     Obtains the name of this class.
final public  Class[]getParameterTypes(int identifier)
     Returns an array of Class objects representing the formal parameter types of the method specified by identifier.
final public  Method[]getReflectiveMethods()
     Returns an array of the methods defined on the given reflective object.
final public  ClassgetReturnType(int identifier)
     Returns a Class objects representing the return type of the method specified by identifier.
public static  Objectinvoke(Object target, int identifier, Object[] args)
     Invokes a method whose name begins with methodPrefix "_m_" and the identifier.
final public  booleanisInstance(Object obj)
     Returns true if obj is an instance of this class.
final public  ObjectnewInstance(Object[] args)
     Creates a new instance of the class.
public  ObjecttrapFieldRead(String name)
     Is invoked when static fields of the base-level class are read and the runtime system intercepts it.
public  voidtrapFieldWrite(String name, Object value)
     Is invoked when static fields of the base-level class are modified and the runtime system intercepts it.
public  ObjecttrapMethodcall(int identifier, Object[] args)
     Is invoked when static methods of the base-level class are called and the runtime system intercepts it.

Field Detail
methodPrefix
final static String methodPrefix(Code)
The base-level methods controlled by a metaobject are renamed so that they begin with methodPrefix "_m_".



methodPrefixLen
final static int methodPrefixLen(Code)



useContextClassLoader
public static boolean useContextClassLoader(Code)
Specifies how a java.lang.Class object is loaded.

If true, it is loaded by:

    Thread.currentThread().getContextClassLoader().loadClass()

If false, it is loaded by Class.forName(). The default value is false.





Constructor Detail
ClassMetaobject
public ClassMetaobject(String[] params)(Code)
Constructs a ClassMetaobject.
Parameters:
  params - params[0] is the name of the classof the reflective objects.




Method Detail
getJavaClass
final public Class getJavaClass()(Code)
Obtains the java.lang.Class representing this class.



getMethod
final public Method getMethod(int identifier)(Code)
Returns the java.lang.reflect.Method object representing the method specified by identifier.

Note that the actual method returned will be have an altered, reflective name i.e. _m_2_...
Parameters:
  identifier - the identifier indexgiven to trapMethodcall() etc.
See Also:   Metaobject.trapMethodcall(intObject[])
See Also:   ClassMetaobject.trapMethodcall(int,Object[])




getMethodIndex
final public int getMethodIndex(String originalName, Class[] argTypes) throws NoSuchMethodException(Code)
Returns the identifier index of the method, as identified by its original name.

This method is useful, in conjuction with ClassMetaobject#getMethod(), to obtain a quick reference to the original method in the reflected class (i.e. not the proxy method), using the original name of the method.

Written by Brett Randall and Shigeru Chiba.
Parameters:
  originalName - The original name of the reflected method
Parameters:
  argTypes - array of Class specifying the method signature the identifier index of the original method
throws:
  NoSuchMethodException - if the method does not exist
See Also:   ClassMetaobject.getMethod(int)




getMethodName
final public String getMethodName(int identifier)(Code)
Returns the name of the method specified by identifier.



getName
final public String getName()(Code)
Obtains the name of this class.



getParameterTypes
final public Class[] getParameterTypes(int identifier)(Code)
Returns an array of Class objects representing the formal parameter types of the method specified by identifier.



getReflectiveMethods
final public Method[] getReflectiveMethods()(Code)
Returns an array of the methods defined on the given reflective object. This method is for the internal use only.



getReturnType
final public Class getReturnType(int identifier)(Code)
Returns a Class objects representing the return type of the method specified by identifier.



invoke
public static Object invoke(Object target, int identifier, Object[] args) throws Throwable(Code)
Invokes a method whose name begins with methodPrefix "_m_" and the identifier.
exception:
  CannotInvokeException - if the invocation fails.



isInstance
final public boolean isInstance(Object obj)(Code)
Returns true if obj is an instance of this class.



newInstance
final public Object newInstance(Object[] args) throws CannotCreateException(Code)
Creates a new instance of the class.
Parameters:
  args - the arguments passed to the constructor.



trapFieldRead
public Object trapFieldRead(String name)(Code)
Is invoked when static fields of the base-level class are read and the runtime system intercepts it. This method simply returns the value of the field.

Every subclass of this class should redefine this method.




trapFieldWrite
public void trapFieldWrite(String name, Object value)(Code)
Is invoked when static fields of the base-level class are modified and the runtime system intercepts it. This method simply sets the field to the given value.

Every subclass of this class should redefine this method.




trapMethodcall
public Object trapMethodcall(int identifier, Object[] args) throws Throwable(Code)
Is invoked when static methods of the base-level class are called and the runtime system intercepts it. This method simply executes the intercepted method invocation with the original parameters and returns the resulting value.

Every subclass of this class should redefine this method.




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.