MetaClassImpl, groovy.lang.MetaObjectProtocol
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: The attribute valueThe class of the object that requested the attribute sender, Object The instance receiver, String The name of the attribute messageName, boolean Whether to look-up on the super class or not useSuper)Retrieves the value of an attribute (field). |
| public ClassNode | Returns: The original AST or null if it cannot be returnedObtains a reference to the original AST for the MetaClass if it is available at runtime |
| public List | |
| public List | Returns: A list of MetaMethodsRedeclares groovy. |
| public List | Returns: A list of MetaProperty instancesRedeclares groovy. |
| public Object | Returns: The properties valueThe java.lang.Class instance that requested the property sender, Object The Object which the property is being retrieved from receiver, String The name of the property property, boolean Whether the call is to a super class property isCallToSuper, boolean ?? fromInsideClass)Retrieves a property on the given receiver for the specified arguments. |
| public void | |
| public Object | Returns: The return value of the methodThe java.lang.Class instance that invoked the method sender, Object The object which the method was invoked on receiver, String The name of the method methodName, Object[] The arguments to the method arguments, boolean Whether the method is a call to a super class method isCallToSuper, boolean Whether the call was invoked from the inside or the outside of the class fromInsideClass)Invokes a method on the given receiver for the specified arguments. |
| public Object | Returns: The results of methodMissing or throws MissingMethodExceptionThe instance to invoke methodMissing on instance, String The name of the method methodName, Object[] The arguments to the method arguments)Attempts to invoke the methodMissing method otherwise throws a MissingMethodException |
| public Object | Returns: The result of the propertyMissing method or throws MissingPropertyExceptionThe instance of the class instance, String The name of the property propertyName, Object The value of the property which could be null in the case of a getter optionalValue, boolean Whether the missing property event was the result of a getter or a setter isGetter)Invokes the propertyMissing method otherwise throws a MissingPropertyException |
| public MetaMethod | Returns: a matching MetaMethod or nullthe name of the method to pick methodName, Class<T>[] the method arguments arguments)Selects a method by name and argument classes. |
| public int | Returns: selected indexThe number of constructors numberOfConstructors, Object[] The arguments arguments)Internal method to support Groovy runtime. |
| public void | setAttribute(Class<T>
The class of the object that requested the attribute sender, Object The instance receiver, String The name of the attribute messageName, Object The value of the attribute messageValue, boolean Whether to look-up on the super class or not useSuper, boolean Whether the call happened from the inside or the outside of a class fromInsideClass)Sets the value of an attribute (field). |
| public void | setProperty(Class<T>
The java.lang.Class instance that is mutating the property sender, Object The Object which the property is being set on receiver, String The name of the property property, Object The new value of the property to set value, boolean Whether the call is to a super class property isCallToSuper, boolean Whether the call was invoked from the inside or the outside of the class fromInsideClass)Sets a property on the given receiver for the specified arguments. |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(Class<T> sender, Object receiver, String messageName, boolean useSuper) Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage. | |
| getClassNode | back to summary |
|---|---|
| public ClassNode getClassNode() Obtains a reference to the original AST for the MetaClass if it is available at runtime
| |
| getMetaMethods | back to summary |
|---|---|
| public List Retrieves a list of MetaMethods held by this class. This list includes MetaMethods added by groovy.lang.ExpandoMetaClass.
| |
| getMethods | back to summary |
|---|---|
| public List Redeclares groovy. Retrieves a list of MetaMethods held by the class. This list does not include MetaMethods added by groovy.lang.ExpandoMetaClass.
| |
| getProperties | back to summary |
|---|---|
| public List Redeclares groovy. Retrieves a list of MetaProperty instances that the MetaClass has
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(Class<T> sender, Object receiver, String property, boolean isCallToSuper, boolean fromInsideClass) Retrieves a property on the given receiver for the specified arguments. The sender is the class that is requesting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided. The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
| |
| initialize | back to summary |
|---|---|
| public void initialize() Complete the initialisation process. After this method is called no methods should be added to the meta class. Invocation of methods or access to fields/properties 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. | |
| invokeMethod | back to summary |
|---|---|
| public Object invokeMethod(Class<T> sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass) Invokes a method on the given receiver for the specified arguments. The sender is the class that invoked the method on the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided. The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
| |
| invokeMissingMethod | back to summary |
|---|---|
| public Object invokeMissingMethod(Object instance, String methodName, Object[] arguments) Attempts to invoke the methodMissing method otherwise throws a MissingMethodException
| |
| invokeMissingProperty | back to summary |
|---|---|
| public Object invokeMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter) Invokes the propertyMissing method otherwise throws a MissingPropertyException
| |
| pickMethod | back to summary |
|---|---|
| public MetaMethod pickMethod(String methodName, Class<T>[] arguments) 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 by the implementation of this MetaClass. pickMethod may or may not be used during the method selection process when invoking a method. There is no warranty for that.
| |
| selectConstructorAndTransformArguments | back to summary |
|---|---|
| public int selectConstructorAndTransformArguments(int numberOfConstructors, Object[] arguments) Internal method to support Groovy runtime. Not for client usage.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(Class<T> sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass) Sets the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(Class<T> sender, Object receiver, String property, Object value, boolean isCallToSuper, boolean fromInsideClass) Sets a property on the given receiver for the specified arguments. The sender is the class that is setting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided. The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
| |