| java.lang.Object groovy.lang.MetaClass groovy.lang.MetaClassImpl
All known Subclasses: groovy.lang.ProxyMetaClass,
MetaClassImpl | public class MetaClassImpl extends MetaClass (Code) | | Allows methods to be dynamically added to existing classes at runtime
author: James Strachan author: Guillaume Laforge author: Jochen Theodorou version: $Revision: 4669 $ See Also: groovy.lang.MetaClass |
Method Summary | |
protected void | addMetaMethod(MetaMethod method) adds a MetaMethod to this class. | public void | addNewInstanceMethod(Method method) | public void | addNewStaticMethod(Method method) | protected void | cacheInstanceMethod(MethodKey key, MetaMethod method) | protected void | cacheStaticMethod(MethodKey key, MetaMethod method) | protected void | checkInitalised() checks if the initialisation of the class id complete.
This method should be called as a form of assert, it is no
way to test if there is still initialisation work to be done. | protected void | clearInvocationCaches() remove all method call cache entries. | public Object | getAttribute(Class sender, Object object, String attribute, boolean useSuper, boolean fromInsideClass) | public Object | getAttribute(Object object, String attribute) | public ClassNode | getClassNode() | public List | getMetaMethods() | public MetaMethod | getMethodWithCaching(Class sender, String methodName, Class[] arguments, boolean isCallToSuper) | public MetaMethod | getMethodWithoutCaching(Class sender, String methodName, Class[] arguments, boolean isCallToSuper) | public List | getMethods() | public List | getProperties() | public Object | getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass) | public Object | getProperty(Object object, String property) | public synchronized void | initialize() | public Object | invokeConstructor(Object[] arguments) | public Object | invokeMethod(Object object, String methodName, Object[] originalArguments) Invokes the given method on the object. | public Object | invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass) Invokes the given method on the object. | public Object | invokeStaticMethod(Object object, String methodName, Object[] arguments) | protected boolean | isInitialized() | public MetaMethod | pickMethod(String methodName, Class[] arguments) | public Constructor | retrieveConstructor(Class[] arguments) | protected MetaMethod | retrieveMethod(String methodName, Class[] arguments) | public MetaMethod | retrieveStaticMethod(String methodName, Class[] arguments) | public int | selectConstructorAndTransformArguments(int numberOfCosntructors, Object[] arguments) | public void | setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass) | public void | setAttribute(Object object, String attribute, Object newValue) | public void | setProperties(Object bean, Map map) | public void | setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass) | public void | setProperty(Object object, String property, Object newValue) | public String | toString() |
addMetaMethod | protected void addMetaMethod(MetaMethod method)(Code) | | adds a MetaMethod to this class. WARNING: this method will not
do the neccessary steps for multimethod logic and using this
method doesn't mean, that a method added here is replacing another
method from a parent class completely. These steps are usually done
by initalize, which means if you need these steps, you have to add
the method before running initialize the first time.
See Also: MetaClassImpl.initialize() See Also: Parameters: method - the MetaMethod |
addNewInstanceMethod | public void addNewInstanceMethod(Method method)(Code) | | |
addNewStaticMethod | public void addNewStaticMethod(Method method)(Code) | | |
checkInitalised | protected void checkInitalised()(Code) | | checks if the initialisation of the class id complete.
This method should be called as a form of assert, it is no
way to test if there is still initialisation work to be done.
Such logic must be implemented in a different way.
throws: IllegalStateException - if the initialisation is incomplete yet |
clearInvocationCaches | protected void clearInvocationCaches()(Code) | | remove all method call cache entries. This should be done if a
method is added during runtime, but not by using a category.
|
getAttribute | public Object getAttribute(Class sender, Object object, String attribute, boolean useSuper, boolean fromInsideClass)(Code) | | Looks up the given attribute (field) on the given object
|
getProperties | public List getProperties()(Code) | | Get all the properties defined for this type
a list of MetaProperty objects |
getProperty | public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass)(Code) | | the given property's value on the object |
initialize | public synchronized void initialize()(Code) | | |
invokeMethod | public Object invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass)(Code) | | Invokes the given method on the object.
|
isInitialized | protected boolean isInitialized()(Code) | | |
selectConstructorAndTransformArguments | public int selectConstructorAndTransformArguments(int numberOfCosntructors, Object[] arguments)(Code) | | |
setAttribute | public void setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass)(Code) | | Sets the given attribute (field) on the given object
|
setProperties | public void setProperties(Object bean, Map map)(Code) | | Sets a number of bean properties from the given Map where the keys are
the String names of properties and the values are the values of the
properties to set
|
setProperty | public void setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass)(Code) | | Sets the property value on an object
|
Methods inherited from groovy.lang.MetaClass | abstract public void addNewInstanceMethod(Method method)(Code)(Java Doc) abstract public void addNewStaticMethod(Method method)(Code)(Java Doc) public Object getAttribute(Class sender, Object receiver, String messageName, boolean useSuper)(Code)(Java Doc) abstract public Object getAttribute(Object object, String attribute)(Code)(Java Doc) abstract public ClassNode getClassNode()(Code)(Java Doc) abstract public List getMetaMethods()(Code)(Java Doc) abstract public List getMethods()(Code)(Java Doc) abstract public List getProperties()(Code)(Java Doc) public Object getProperty(Class sender, Object receiver, String messageName, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc) abstract public Object getProperty(Object object, String property)(Code)(Java Doc) abstract public void initialize()(Code)(Java Doc) abstract public Object invokeConstructor(Object[] arguments)(Code)(Java Doc) public Object invokeConstructorAt(Class at, Object[] arguments)(Code)(Java Doc) public Object invokeMethod(Object object, String methodName, Object arguments)(Code)(Java Doc) public Object invokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)(Code)(Java Doc) abstract public Object invokeMethod(Object object, String methodName, Object[] arguments)(Code)(Java Doc) public Object invokeMissingMethod(Object instance, String methodName, Object[] arguments)(Code)(Java Doc) abstract public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)(Code)(Java Doc) public boolean isGroovyObject()(Code)(Java Doc) public static boolean isUseReflection()(Code)(Java Doc) abstract public MetaMethod pickMethod(String methodName, Class[] arguments)(Code)(Java Doc) protected MetaMethod retrieveMethod(String methodName, Class[] arguments)(Code)(Java Doc) public void setAttribute(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc) abstract public void setAttribute(Object object, String attribute, Object newValue)(Code)(Java Doc) public void setProperty(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc) abstract public void setProperty(Object object, String property, Object newValue)(Code)(Java Doc) public static void setUseReflection(boolean useReflection)(Code)(Java Doc)
|
|
|