Class ConstructorMetaMethodSite
java.lang.Object
org.codehaus.groovy.runtime.callsite.AbstractCallSite
org.codehaus.groovy.runtime.callsite.MetaClassSite
org.codehaus.groovy.runtime.callsite.MetaMethodSite
org.codehaus.groovy.runtime.callsite.ConstructorMetaMethodSite
- 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.MetaMethodSite
paramsFields inherited from class org.codehaus.groovy.runtime.callsite.MetaClassSite
metaClassFields inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
array, index, name -
Constructor Summary
ConstructorsConstructorDescriptionConstructorMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod method, Class[] params) -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectcallConstructor(Object receiver, Object[] args) Whenreceiveris the meta-class's class, the meta-class version is unchanged, andMetaClassHelper.sameClasses(Class[], Object[])matchesargsto the cached parameter classes, unwrapsargsand invokes the cached meta-method on that class.final ObjectUnwrapsargsand invokes the cached meta-method on the meta-class's class, ignoringreceiver.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
-
ConstructorMetaMethodSite
public ConstructorMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod method, Class[] params)
-
-
Method Details
-
invoke
Unwrapsargsand invokes the cached meta-method on the meta-class's class, ignoringreceiver. AGroovyRuntimeExceptionis rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException).- Throws:
Throwable
-
callConstructor
Whenreceiveris the meta-class's class, the meta-class version is unchanged, andMetaClassHelper.sameClasses(Class[], Object[])matchesargsto the cached parameter classes, unwrapsargsand invokes the cached meta-method on that class. AGroovyRuntimeExceptionis rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException). Otherwise falls back toCallSiteArray.defaultCallConstructor(CallSite, Object, Object[]).- Specified by:
callConstructorin interfaceCallSite- Overrides:
callConstructorin classAbstractCallSite- Parameters:
receiver- the constructor's owner, as supplied by the callerargs- the constructor arguments, in order- Returns:
- the constructed object
- Throws:
Throwable- when construction fails
-