public class ProxyMetaClass extends MetaClassImpl
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Modifiers | Name | Description |
---|---|---|
protected MetaClass |
adaptee |
|
protected Interceptor |
interceptor |
Fields inherited from class | Fields |
---|---|
class MetaClassImpl |
EMPTY_ARGUMENTS, INVOKE_METHOD_METHOD, METHOD_MISSING, PROPERTY_MISSING, STATIC_METHOD_MISSING, STATIC_PROPERTY_MISSING, getPropertyMethod, invokeMethodMethod, isGroovyObject, isMap, metaMethodIndex, registry, setPropertyMethod, theCachedClass, theClass |
Constructor and description |
---|
ProxyMetaClass
(MetaClassRegistry registry, Class theClass, MetaClass adaptee) @param adaptee the MetaClass to decorate with interceptability |
Type | Name and description |
---|---|
MetaClass |
getAdaptee() |
static ProxyMetaClass |
getInstance(Class theClass) convenience factory method for the most usual case. |
Interceptor |
getInterceptor() @return the interceptor in use or null if no interceptor is used |
Object |
getProperty(Class aClass, Object object, String property, boolean b, boolean b1) Interceptors the call to getProperty if a PropertyAccessInterceptor is available |
void |
initialize() |
Object |
invokeConstructor(Object[] arguments) Call invokeConstructor on adaptee with logic like in MetaClass unless we have an Interceptor. |
Object |
invokeMethod(Object object, String methodName, Object[] arguments) Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor. |
Object |
invokeStaticMethod(Object object, String methodName, Object[] arguments) Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor. |
void |
setAdaptee(MetaClass metaClass) |
void |
setInterceptor(Interceptor interceptor) @param interceptor may be null to reset any interception |
void |
setProperty(Class aClass, Object object, String property, Object newValue, boolean b, boolean b1) Interceptors the call to a property setter if a PropertyAccessInterceptor is available |
Object |
use(Closure closure) Use the ProxyMetaClass for the given Closure. |
Object |
use(GroovyObject object, Closure closure) Use the ProxyMetaClass for the given Closure. |
adaptee
- the MetaClass to decorate with interceptabilityconvenience factory method for the most usual case.
Interceptors the call to getProperty if a PropertyAccessInterceptor is available
object
- the object to invoke the getter onproperty
- the property nameCall invokeConstructor on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.
Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.
Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.
interceptor
- may be null to reset any interceptionInterceptors the call to a property setter if a PropertyAccessInterceptor is available
object
- The object to invoke the setter onproperty
- The property name to setnewValue
- The new value of the propertyUse the ProxyMetaClass for the given Closure. Cares for balanced register/unregister.
closure
- piece of code to be executed with registered ProxyMetaClassUse the ProxyMetaClass for the given Closure. Cares for balanced setting/unsetting ProxyMetaClass.
closure
- piece of code to be executed with ProxyMetaClassCopyright © 2003-2015 The Apache Software Foundation. All rights reserved.