Class StaticMetaClassSite
java.lang.Object
org.codehaus.groovy.runtime.callsite.AbstractCallSite
org.codehaus.groovy.runtime.callsite.MetaClassSite
org.codehaus.groovy.runtime.callsite.StaticMetaClassSite
- All Implemented Interfaces:
CallSite
Call site for invoking static methods
metaclass - cached
method - not cached
-
Field Summary
Fields inherited from class org.codehaus.groovy.runtime.callsite.MetaClassSite
metaClassFields inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
array, index, name -
Constructor Summary
ConstructorsConstructorDescriptionStaticMetaClassSite(CallSite site, MetaClass metaClass) CachesmetaClassand the version of its class so a later call can tell whether that meta-class is still current. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectInvokesnameas a static method whenreceiveris the cached class and that class's meta-class version is unchanged.final ObjectcallStatic(Class receiver, Object[] args) Invokesnameas a static method whenreceiveris still the cached class and the meta-class version matches.Methods inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
acceptGetProperty, acceptGroovyObjectGetProperty, call, call, call, call, call, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callCurrent, callCurrent, callCurrent, callCurrent, callCurrent, callCurrent, callGetProperty, callGetPropertySafe, callGroovyObjectGetProperty, callGroovyObjectGetPropertySafe, callSafe, callSafe, callSafe, callSafe, callSafe, callSafe, callStatic, callStatic, callStatic, callStatic, callStatic, createGetPropertySite, createGroovyObjectGetPropertySite, getArray, getIndex, getName, getProperty
-
Constructor Details
-
StaticMetaClassSite
CachesmetaClassand the version of its class so a later call can tell whether that meta-class is still current.- Parameters:
site- the site whose name and index are reusedmetaClass- the meta-class used for static invocation
-
-
Method Details
-
call
Invokesnameas a static method whenreceiveris the cached class and that class's meta-class version is unchanged. Otherwise uses the default call. AGroovyRuntimeExceptionfrom the static invocation is rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException).- Specified by:
callin interfaceCallSite- Overrides:
callin classAbstractCallSite- Parameters:
receiver- the class the static method is invoked onargs- the call arguments- Returns:
- the call result
- Throws:
Throwable- when the call fails
-
callStatic
Invokesnameas a static method whenreceiveris still the cached class and the meta-class version matches. Otherwise uses the default static call. AGroovyRuntimeExceptionfrom the static invocation is rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException).- Specified by:
callStaticin interfaceCallSite- Overrides:
callStaticin classAbstractCallSite- Parameters:
receiver- the class the static method is invoked onargs- the call arguments- Returns:
- the call result
- Throws:
Throwable- when the call fails
-