groovy.lang.MetaClass
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public static class | |
| private static enum | |
| public static class | MetaClassImpl.MetaConstructor
This is a helper class introduced in Groovy 2.1.0, which is used only by indy. |
| pack-priv static class | |
| private abstract class |
| Modifier and Type | Field and Description |
|---|---|
| private final MetaMethod[] | |
| private final List | |
| private static final MetaMethod | |
| private final MetaProperty | |
| private static final Comparator | |
| private static final String | |
| private ClassNode | |
| private final MetaClassImpl. | |
| private final MetaClassImpl. | |
| private static final String | |
| private FastArray | |
| private static final String | |
| public static final Object[] | |
| private MetaMethod | |
| private MetaMethod | |
| private static final String | |
| protected MetaMethod | |
| private static final Class | |
| private volatile boolean | |
| private static final boolean | |
| protected static final String | |
| protected MetaMethod | |
| protected final boolean | |
| protected final boolean | |
| private final Map | |
| private MetaMethodIndex. | |
| protected final MetaMethodIndex | |
| private static final SingleKeyHashMap. | |
| protected static final String | |
| private static final Class | |
| private MetaMethod | |
| private final MetaMethod[] | |
| private static final SingleKeyHashMap. | |
| private final Set | |
| private static final boolean | |
| private boolean | |
| private static final ConcurrentMap | |
| protected static final String | |
| private MetaMethod | |
| private MetaMethod | |
| protected MetaClassRegistry | |
| private static final String | |
| protected MetaMethod | |
| private static final Class | |
| protected static final String | |
| protected static final String | |
| private final SingleKeyHashMap | |
| protected final CachedClass | |
| protected final Class | |
| private static final VMPlugin |
| Access | Constructor and Description |
|---|---|
| public | MetaClassImpl(final Class<T>
The class this is the metaclass dor theClass, final MetaMethod[] The methods for this class add)Constructor |
| public | MetaClassImpl(final Class<T>
The class this is the metaclass dor theClass)Constructor that sets the methods to null |
| public | MetaClassImpl(final MetaClassRegistry
The metaclass registry for this MetaClass registry, final Class<T> The class theClass, final MetaMethod[] The methods add)Constructor with registry |
| public | MetaClassImpl(MetaClassRegistry
The metaclass registry for this MetaClass registry, final Class<T> The class theClass)Constructor with registry setting methods to null |
| Modifier and Type | Method and Description |
|---|---|
| private static Object | |
| private static void | |
| public void | addMetaBeanProperty(MetaBeanProperty
The MetaBeanProperty mp)Implements groovy. |
| public void | addMetaMethod(MetaMethod
the MetaMethod method)Implements groovy. |
| protected void | |
| public void | addNewInstanceMethod(final Method
The method to be added method)Implements groovy. |
| private void | |
| public void | addNewStaticMethod(final Method
The method to be added method)Implements groovy. |
| private void | |
| private void | |
| private void | |
| protected void | |
| private void | applyStrayPropertyMethods(LinkedList<CachedClass> superClasses, MetaClassImpl.
|
| private CachedClass | |
| private static boolean | |
| protected final void | checkIfGroovyObjectMethod(MetaMethod
The metaMethod instance metaMethod)Checks if the metaMethod is a method from the GroovyObject interface such as setProperty, getProperty and invokeMethod |
| private void | |
| protected void | |
| protected Object | chooseMethod(String methodName, Object
the possible methods to choose from methodOrList, Class<T>[] the arguments arguments)Chooses the correct method to use from a list of methods which match by name. |
| private Object | |
| private Object | |
| protected void | |
| private void | |
| private void | |
| private static void | |
| private CachedConstructor | |
| public CallSite | |
| protected static String | createErrorMessageForAmbiguity(String theClassName, String name, Class<T>[] arguments, LinkedList<E> matches)
|
| private static void | createMetaBeanProperty(SingleKeyHashMap propertyIndex, String propName, boolean isGetter, MetaMethod propertyMethod)
|
| private Tuple2 | createMetaMethodAndMetaProperty(final Class<T> senderForMP, final Class<T> senderForCMG, final String name, final boolean useSuper, final boolean isStatic)
|
| public CallSite | |
| public CallSite | |
| public CallSite | |
| public CallSite | |
| protected MetaMethod | |
| private static int | |
| protected static Object | doChooseMostSpecificParams(String theClassName, String name, List<E> matchingMethods, Class<T>[] arguments, boolean checkParametersCompatible)
|
| protected void | |
| protected void | |
| private static MetaProperty | |
| private void | |
| private static void | |
| private static Object | filterPropertyMethod(Object methodOrList, boolean isGetter, boolean booleanGetter)
return null if nothing valid has been found, a MetaMethod (for getter always the case if not null) or a LinkedList<MetaMethod> if there are multiple setter |
| private static GroovyCategorySupport. | findCategoryMethod(final String name, final Class<?> sender, final Predicate<CachedClass[]> paramFilter)
|
| private int | findMatchingMethod(final MetaMethod method, final String mopName, final int index, final CachedMethod[] mopMethods)
|
| private int | |
| private MetaMethod | |
| protected static MetaMethod | findMethodInClassHierarchy(Class<T> instanceKlazz, String methodName, Class<T>[] arguments, MetaClass metaClass)
|
| protected MetaMethod | |
| protected static MetaMethod | findOwnMethod(Class<T> instanceKlazz, String methodName, Class<T>[] arguments, MetaClass metaClass, MetaMethod method)
|
| protected MetaBeanProperty | |
| private static MetaMethod | findSubClassMethod(Class<T> instanceKlazz, String methodName, Class<T>[] arguments, MetaClass metaClass, MetaMethod method)
|
| private static MetaMethod | |
| public MetaMethod[] | Returns: A list of MetaMethodsRetrieves a list of additional MetaMethods held by this class |
| public Object | Returns: The attribute valueThe class of the object that requested the attribute sender, final Object The instance object, final String The name of the attribute attribute, final boolean Whether to look-up on the super class or not useSuper)Implements groovy. |
| public Object | Returns: The attribute valueThe class of the object that requested the attribute sender, final Object The instance the attribute is to be retrieved from object, final String The name of the attribute attribute, final boolean Whether to look-up on the super class or not useSuper, final boolean Whether the call was invoked from the inside or the outside of the class. fromInsideClass)Retrieves the value of an attribute (field). |
| public Object | Returns: The attribute valueThe object to get the attribute from object, final String The name of the attribute attribute)Implements groovy. |
| private static GroovyCategorySupport. | |
| private static GroovyCategorySupport. | |
| private static GroovyCategorySupport. | |
| public ClassInfo | Returns: The ClassInfo for the contained class.Returns the ClassInfo for the contained Class |
| public ClassNode | Returns: The original AST or null if it cannot be returnedImplements groovy. |
| public MetaProperty | getEffectiveGetMetaProperty(final Class<T> sender, final Object object, String name, final boolean useSuper)
|
| private static Boolean | Returns: false: add method
null : ignore method
true : replace
|
| public MetaMethod | getMetaMethod(final String
The name of the MetaMethod name, final Object[] Array containing - 1) the argument values (using which their types are then inferred), or 2) the corresponding argument types argTypes)Implements groovy. |
| private MetaMethod | getMetaMethod(Class<T> sender, Object object, String methodName, boolean isCallToSuper, Object... arguments)
|
| private static MetaMethod | getMetaMethod(Class<T> instanceKlazz, String methodName, Class<T>[] arguments, MetaClass metaClass, MetaMethod method)
|
| public List | Returns: A list of MetaMethodsImplements groovy. |
| public MetaProperty | getMetaProperty(final String
The name of the MetaProperty name)Implements groovy. |
| private MetaProperty | |
| private MetaProperty | |
| private static MetaBeanProperty | |
| private Object | Returns: all the normal instance methods available on this class for the given nameGets all instance methods available on this class for the given name |
| public List | Returns: A list of MetaMethodsImplements groovy. |
| public MetaMethod | |
| private MetaMethod | |
| public MetaMethod | getMethodWithoutCaching(Class<T> sender, String methodName, Class<T>[] arguments, boolean isCallToSuper)
|
| private MetaMethod[] | |
| private MetaMethod | |
| public List | Returns: a list of MetaProperty objectsImplements groovy. |
| public Object | Returns: the given property's value on the objectThe java.lang.Class instance that requested the property sender, Object The Object which the property is being retrieved from object, String The name of the property name, boolean Whether the call is to a super class property useSuper, boolean ?? fromInsideClass)Implements groovy. Retrieves a property on the given receiver for the specified arguments. |
| public Object | Returns: The properties valueThe Object which the property is being retrieved from object, String The name of the property property)Implements groovy. Retrieves a property on the given object for the specified arguments. |
| private static String | |
| public MetaClassRegistry | |
| public MetaMethod | getStaticMetaMethod(final String
The name of the MetaMethod name, final Object[] The argument types argTypes)Implements groovy. |
| private Object | Returns: all the normal static methods available on this class for the given nameReturns all the normal static methods on this class for the given name |
| protected Object | |
| protected LinkedList | |
| private MetaMethod | |
| public final CachedClass | |
| public Class | Returns: The class contained by this metaclassImplements groovy. |
| public int | |
| protected static long | |
| public boolean | Returns: true - if the method invocation is not done by the meta class itselfindicates is the meta class method invocation for non-static methods is done through a custom invoker object. |
| public boolean | Returns: true - if the method invocation is not done by the meta class itselfindicates is the meta class method invocation for static methods is done through a custom invoker object. |
| public MetaProperty | hasProperty(final Object
The object to inspect obj, final String The name of the property name)Implements groovy. Returns true of the implementing MetaClass has a property of the given name Note that this method will only return true for realised properties and does not take into account implementation of getProperty or propertyMissing |
| public void | |
| private void | |
| private void | |
| private void | |
| public synchronized void | |
| public Object | invokeConstructor(Object[]
The arguments to the constructor arguments)Implements groovy. |
| private Object | |
| public Object | Returns: The result of the method invocation.The object the method should be invoked on. object, final String The name of the method to invoke. methodName, final Object The arguments to the invoked method as null, a Tuple, an array or a single argument of any type. arguments)Implements groovy. |
| public Object | Returns: The return value of the methodThe object which the method was invoked on object, String The name of the method methodName, Object[] The arguments to the method originalArguments)Implements groovy. |
| 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 object, String The name of the method methodName, Object[] The arguments to the method originalArguments, 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)Implements groovy. Invokes a method on the given receiver for the specified arguments. |
| private Tuple2 | invokeMethod(MetaMethod method, Object delegate, Closure<V> closure, String methodName, Class<T>[] argClasses, Object[] originalArguments, Object owner)
|
| private Object | |
| private static Object | |
| public Object | Returns: The result of the method invocation.The object the method should be invoked on. instance, final String The name of the method to invoke. methodName, final Object[] The arguments to the invoked method. arguments)Implements groovy. |
| private Object | invokeMissingMethod(final Object instance, final String methodName, final Object[] arguments, final RuntimeException original, final boolean isCallToSuper)
|
| public Object | Returns: The result of the method invocation.The object the method should be invoked on. instance, final String The name of the property to invoke. propertyName, final Object The (optional) new value for the property optionalValue, final boolean Whether the method is a getter isGetter)Implements groovy. |
| private Object | invokePropertyOrMissing(final Object object, final String methodName, final Object[] originalArguments, final boolean fromInsideClass, final boolean isCallToSuper)
Tries to find a callable property and make the call. |
| private static Object | |
| public Object | invokeStaticMethod(Object
An instance of the class returned by the getTheClass() method or the class itself object, String The name of the method methodName, Object[] The arguments to the method arguments)Implements groovy. |
| private Object | |
| protected Object | Returns: The value in the case of a getter or a MissingPropertyExceptionThe instance instance, String The name of the property propertyName, Object The value in the case of a setter optionalValue, boolean True if its a getter isGetter)Hook to deal with the case of MissingProperty for static properties. |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| public boolean | Returns: true if this is a groovy class, false otherwise.Return whether the class represented by this metaclass instance is an instance of the GroovyObject class |
| protected boolean | |
| private static boolean | |
| public boolean | Returns: falseImplements groovy. |
| public boolean | |
| private static boolean | |
| private MetaClass | |
| private static MetaProperty | makeReplacementMetaProperty(MetaProperty mp, String propName, boolean isGetter, MetaMethod propertyMethod)
|
| private void | |
| private static MetaMethod | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public MetaMethod | Returns: a matching MetaMethod or nullthe name of the method to pick methodName, Class<T>[] the method arguments arguments)Implements groovy. |
| private MetaMethod | |
| private void | |
| protected synchronized void | |
| private void | |
| private void | |
| public List | respondsTo(final Object
The object to inspect obj, final String The name of the method of interest name, final Object[] The argument types to match against argTypes)Implements groovy. Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types. |
| public List | respondsTo(final Object
The object to inspect obj, final String The name of the method of interest name)Implements groovy. Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of arguments. |
| public Constructor | |
| public MetaMethod | retrieveConstructor(Object[] arguments)
This is a helper method added in Groovy 2.1.0, which is used only by indy. |
| private Object | |
| public MetaMethod | |
| private static boolean | |
| private static MetaMethod | searchInterfacesForMetaMethod(Class<T> instanceKlazz, String methodName, Class<T>[] arguments, MetaClass metaClass)
|
| private MetaBeanProperty | |
| public int | selectConstructorAndTransformArguments(int
The number of constructors numberOfConstructors, Object[] The arguments arguments)Implements groovy. |
| private int | |
| private int | Returns: a hash used to identify the constructor to be calledthe actual constructor call arguments arguments)Constructor selection algorithm for Groovy 2.1.9+. |
| public void | setAttribute(final Class<T>
The java.lang.Class instance that is mutating the property sender, final Object The Object which the property is being set on object, final String The name of the attribute, attribute, final Object The new value of the attribute to set newValue, final boolean Whether the call is to a super class property useSuper, final boolean Whether the call was invoked from the inside or the outside of the class fromInsideClass)Implements groovy. Sets an attribute on the given receiver for the specified arguments. |
| public void | setAttribute(final Object
The object to get the attribute from object, final String The name of the attribute attribute, final Object The new value of the attribute newValue)Implements groovy. |
| protected void | |
| public void | |
| public void | setProperties(Object bean, Map<K, V> map)
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 |
| 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 object, String The name of the property name, Object The new value of the property to set newValue, boolean Whether the call is to a super class property useSuper, boolean Whether the call was invoked from the inside or the outside of the class. fromInsideClass)Implements groovy. Retrieves a property on the given receiver for the specified arguments. |
| public void | setProperty(Object
The Object which the property is being retrieved from object, String The name of the property property, Object The new value newValue)Implements groovy. Sets a property on the given object for the specified arguments. |
| private void | setupProperties(PropertyDescriptor[]
the property descriptors propertyDescriptors)This will build up the property map (Map of MetaProperty objects, keyed on property name). |
| public String | |
| private MetaMethod | tryListParamMetaMethod(Class<T> sender, String methodName, boolean isCallToSuper, Object[] arguments)
|