Java Doc for MetaClass.java in  » Scripting » groovy-1.0 » groovy » lang » 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 » groovy 1.0 » groovy.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   groovy.lang.MetaClass

All known Subclasses:   groovy.lang.MetaClassImpl,  groovy.lang.DelegatingMetaClass,
MetaClass
abstract public class MetaClass (Code)
Base class for meta class implementations. The meta class is used to invoke methods or to get fields/properties. For proper initialization of this class it is not enough to only call the constructor, the initialize() must be called too. The invoke methods should check that initialize() was called. Adding methods is valid unless initilise method was called. Therefore addNewStaticMethod and addNewInstanceMethod should check that that initilise awas not called before.
author:
   John Wilson


Field Summary
final public static  ObjectNO_METHOD_FOUND
    
final protected static  Loggerlog
    
final protected  ClasstheClass
    
protected static  booleanuseReflection
    

Constructor Summary
protected  MetaClass(Class theClass)
    

Method Summary
abstract public  voidaddNewInstanceMethod(Method method)
     adds a new instance method to this meta class.
abstract public  voidaddNewStaticMethod(Method method)
     adds a new static method to this meta class.
public  ObjectgetAttribute(Class sender, Object receiver, String messageName, boolean useSuper)
    
abstract public  ObjectgetAttribute(Object object, String attribute)
    
abstract public  ClassNodegetClassNode()
    
abstract public  ListgetMetaMethods()
    
abstract public  ListgetMethods()
    
abstract public  ListgetProperties()
    
public  ObjectgetProperty(Class sender, Object receiver, String messageName, boolean useSuper, boolean fromInsideClass)
    
abstract public  ObjectgetProperty(Object object, String property)
    
abstract public  voidinitialize()
     complete the initlialisation process.
abstract public  ObjectinvokeConstructor(Object[] arguments)
    
public  ObjectinvokeConstructorAt(Class at, Object[] arguments)
    
public  ObjectinvokeMethod(Object object, String methodName, Object arguments)
    
public  ObjectinvokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)
    
abstract public  ObjectinvokeMethod(Object object, String methodName, Object[] arguments)
    
public  ObjectinvokeMissingMethod(Object instance, String methodName, Object[] arguments)
    
abstract public  ObjectinvokeStaticMethod(Object object, String methodName, Object[] arguments)
    
public  booleanisGroovyObject()
    
public static  booleanisUseReflection()
    
abstract public  MetaMethodpickMethod(String methodName, Class[] arguments)
     Selects a method by name and argument classes.
protected  MetaMethodretrieveMethod(String methodName, Class[] arguments)
    
public  voidsetAttribute(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)
    
abstract public  voidsetAttribute(Object object, String attribute, Object newValue)
    
public  voidsetProperty(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)
    
abstract public  voidsetProperty(Object object, String property, Object newValue)
    
public static  voidsetUseReflection(boolean useReflection)
     Allows reflection to be enabled in situations where bytecode generation of method invocations causes issues.

Field Detail
NO_METHOD_FOUND
final public static Object NO_METHOD_FOUND(Code)



log
final protected static Logger log(Code)



theClass
final protected Class theClass(Code)



useReflection
protected static boolean useReflection(Code)




Constructor Detail
MetaClass
protected MetaClass(Class theClass)(Code)




Method Detail
addNewInstanceMethod
abstract public void addNewInstanceMethod(Method method)(Code)
adds a new instance method to this meta class. Instance methods are able to overwrite the original methods of the class. Calling this method should not be done after initlise was called.
Parameters:
  method - the method to be added



addNewStaticMethod
abstract public void addNewStaticMethod(Method method)(Code)
adds a new static method to this meta class. This is only possible as long as initilise was not called.
Parameters:
  method - the method to be added



getAttribute
public Object getAttribute(Class sender, Object receiver, String messageName, boolean useSuper)(Code)



getAttribute
abstract public Object getAttribute(Object object, String attribute)(Code)



getClassNode
abstract public ClassNode getClassNode()(Code)



getMetaMethods
abstract public List getMetaMethods()(Code)



getMethods
abstract public List getMethods()(Code)



getProperties
abstract public List getProperties()(Code)



getProperty
public Object getProperty(Class sender, Object receiver, String messageName, boolean useSuper, boolean fromInsideClass)(Code)



getProperty
abstract public Object getProperty(Object object, String property)(Code)



initialize
abstract public void initialize()(Code)
complete the initlialisation process. After this method is called no methods should be added to the meta class. Invocation of methods or access to fields/proeprties is forbidden unless this method is called. This method should contain any initialisation code, taking a longer time to complete. An example is the creation of the Reflector. It is suggested to synchronize this method.



invokeConstructor
abstract public Object invokeConstructor(Object[] arguments)(Code)



invokeConstructorAt
public Object invokeConstructorAt(Class at, Object[] arguments)(Code)
Warning, this method will be removed



invokeMethod
public Object invokeMethod(Object object, String methodName, Object arguments)(Code)



invokeMethod
public Object invokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)(Code)



invokeMethod
abstract public Object invokeMethod(Object object, String methodName, Object[] arguments)(Code)



invokeMissingMethod
public Object invokeMissingMethod(Object instance, String methodName, Object[] arguments)(Code)



invokeStaticMethod
abstract public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)(Code)



isGroovyObject
public boolean isGroovyObject()(Code)



isUseReflection
public static boolean isUseReflection()(Code)



pickMethod
abstract public MetaMethod pickMethod(String methodName, Class[] arguments)(Code)
Selects a method by name and argument classes. This method does not search for an exact match, it searches for a compatible method. For this the method selection mechanism is used as provided bye the implementation of this MetaClass. pickMethod may or may not used during the method selection process when invoking a method thereis no warranty for that.
throws:
  GroovyRuntimeException - if there is more than one matching method



retrieveMethod
protected MetaMethod retrieveMethod(String methodName, Class[] arguments)(Code)
Warning, this method will be removed



setAttribute
public void setAttribute(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)(Code)



setAttribute
abstract public void setAttribute(Object object, String attribute, Object newValue)(Code)



setProperty
public void setProperty(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)(Code)



setProperty
abstract public void setProperty(Object object, String property, Object newValue)(Code)



setUseReflection
public static void setUseReflection(boolean useReflection)(Code)
Allows reflection to be enabled in situations where bytecode generation of method invocations causes issues.
Parameters:
  useReflection -



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.