Class ConstructorSite.NoParamSiteInnerClass
java.lang.Object
org.codehaus.groovy.runtime.callsite.AbstractCallSite
org.codehaus.groovy.runtime.callsite.MetaClassSite
org.codehaus.groovy.runtime.callsite.ConstructorSite
org.codehaus.groovy.runtime.callsite.ConstructorSite.ConstructorSiteNoUnwrapNoCoerce
org.codehaus.groovy.runtime.callsite.ConstructorSite.NoParamSiteInnerClass
- All Implemented Interfaces:
CallSite
- Enclosing class:
- ConstructorSite
public static class ConstructorSite.NoParamSiteInnerClass
extends ConstructorSite.ConstructorSiteNoUnwrapNoCoerce
Constructor site that, after the inherited
ConstructorSite.checkCall(Object, Object[])
passes, invokes the cached constructor with only args[0] and
then applies args[1] as a property map. Those constructor
arguments are neither unwrapped nor coerced. Otherwise it falls back
to the default constructor call.-
Nested Class Summary
Nested classes/interfaces inherited from class org.codehaus.groovy.runtime.callsite.ConstructorSite
ConstructorSite.ConstructorSiteNoUnwrap, ConstructorSite.ConstructorSiteNoUnwrapNoCoerce, ConstructorSite.NoParamSite, ConstructorSite.NoParamSiteInnerClass -
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
ConstructorsConstructorDescriptionNoParamSiteInnerClass(CallSite site, MetaClassImpl metaClass, CachedConstructor constructor, Class[] params) Delegates toConstructorSite.ConstructorSiteNoUnwrapNoCoerce, recording the same meta-class version. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectcallConstructor(Object receiver, Object[] args) WhenConstructorSite.checkCall(Object, Object[])passes, callsCachedConstructor.invoke(Object[])with a one-element array holdingargs[0], then castsargs[1]toMapand passes it toMetaClassImpl.setProperties(Object, Map).Methods inherited from class org.codehaus.groovy.runtime.callsite.ConstructorSite
checkCall, createConstructorSiteMethods 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
-
NoParamSiteInnerClass
public NoParamSiteInnerClass(CallSite site, MetaClassImpl metaClass, CachedConstructor constructor, Class[] params) Delegates toConstructorSite.ConstructorSiteNoUnwrapNoCoerce, recording the same meta-class version.
-
-
Method Details
-
callConstructor
WhenConstructorSite.checkCall(Object, Object[])passes, callsCachedConstructor.invoke(Object[])with a one-element array holdingargs[0], then castsargs[1]toMapand passes it toMetaClassImpl.setProperties(Object, Map). Those constructor arguments are neither unwrapped nor coerced. AGroovyRuntimeExceptionfrom setting properties is rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException). Otherwise falls back toCallSiteArray.defaultCallConstructor(CallSite, Object, Object[]).- Specified by:
callConstructorin interfaceCallSite- Overrides:
callConstructorin classConstructorSite.ConstructorSiteNoUnwrapNoCoerce- 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
-