Class MetaClassConstructorSite
java.lang.Object
org.codehaus.groovy.runtime.callsite.AbstractCallSite
org.codehaus.groovy.runtime.callsite.MetaClassSite
org.codehaus.groovy.runtime.callsite.MetaClassConstructorSite
- All Implemented Interfaces:
CallSite
Call site for constructor
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
ConstructorsConstructorDescriptionMetaClassConstructorSite(CallSite site, MetaClass metaClass) CachesmetaClassand the version of its class so a later constructor call can tell whether that meta-class is still current. -
Method Summary
Modifier and TypeMethodDescriptioncallConstructor(Object receiver, Object[] args) Invokes the constructor through the cached meta-class whenreceiveris that meta-class's class and the version is unchanged.Methods inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
acceptGetProperty, acceptGroovyObjectGetProperty, call, call, call, call, call, call, 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, callStatic, createGetPropertySite, createGroovyObjectGetPropertySite, getArray, getIndex, getName, getProperty
-
Constructor Details
-
MetaClassConstructorSite
CachesmetaClassand the version of its class so a later constructor call can tell whether that meta-class is still current.- Parameters:
site- the site whose name and index are reusedmetaClass- the meta-class used to invoke the constructor
-
-
Method Details
-
callConstructor
Invokes the constructor through the cached meta-class whenreceiveris that meta-class's class and the version is unchanged. Otherwise uses the default constructor call. AGroovyRuntimeExceptionis rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException).- Specified by:
callConstructorin interfaceCallSite- Overrides:
callConstructorin classAbstractCallSite- Parameters:
receiver- the class being constructedargs- the constructor arguments- Returns:
- the new instance
- Throws:
Throwable- when construction fails
-