Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.dynjs.runtime.linker.java;
 
 
        super(ExecutionContext.classlogger);
        this. = manager;
    }
    @Override
    public StrategicLink linkConstruct(StrategyChain chainObject receiverObject[] argsBinder binderBinder guardBinderthrows NoSuchMethodException,
            IllegalAccessException {
        if (!(receiver instanceof Class<?>)) {
            return chain.nextStrategy();
        }
        if (args.length == 1 && args[0] instanceof JSObject) {
            binder = binder.spread(JSObject.class)
                    .convert(Object.classClass.classExecutionContext.classJSObject.class);
            MethodHandle guard = getConstructGuard((Class<?>) receiverguardBinder);
            return new StrategicLink(makeImplementation(binder), guard);
        }
        return chain.nextStrategy();
    }
        return binder
                .insert(0, this.)
                .invokeStatic(lookup(), JSJavaImplementationLinkStrategy.class"makeImplementation");
    }
    public static Object makeImplementation(JSJavaImplementationManager managerClass<?> targetClassExecutionContext contextJSObject implementationthrows Exception {
        return manager.getImplementationWrapper(targetClasscontextimplementation);
    }
    private MethodHandle getConstructGuard(Class<?> targetClassBinder binderthrows NoSuchMethodExceptionIllegalAccessException {
        return binder
                .drop(0)
                .insert(2, targetClass)
                .invokeStatic(lookup(), JSJavaImplementationLinkStrategy.class"constructGuard");
    }
    public static boolean constructGuard(Object targetClassObject[] argsClass<?> expectedTargetClass) {
        if (targetClass != expectedTargetClass) {
            return false;
        }
        if (args.length != 1) {
            return false;
        }
        if (!(args[0] instanceof JSObject)) {
            return false;
        }
        return true;
    }
New to GrepCode? Check out our FAQ X