
org.codehaus.groovy.runtime.callsite.ConstructorMetaClassSite Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of groovy-all-jdk14 Show documentation
Show all versions of groovy-all-jdk14 Show documentation
Groovy: A powerful, dynamic language for the JVM
The newest version!
package org.codehaus.groovy.runtime.callsite;
import org.codehaus.groovy.runtime.ScriptBytecodeAdapter;
import groovy.lang.GroovyRuntimeException;
import groovy.lang.MetaClass;
public class ConstructorMetaClassSite extends MetaClassSite {
public ConstructorMetaClassSite(CallSite site, MetaClass metaClass) {
super(site, metaClass);
}
public Object callConstructor(Object receiver, Object[] args) throws Throwable {
if (receiver == metaClass.getTheClass()) {
try {
return metaClass.invokeConstructor(args);
} catch (GroovyRuntimeException gre) {
throw ScriptBytecodeAdapter.unwrap(gre);
}
} else {
return CallSiteArray.defaultCallConstructor(this, (Class)receiver, args);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy