public void visitPropertyExpression(PropertyExpression expression) { Expression objectExpression = expression.getObjectExpression(); MethodCallerMultiAdapter adapter; if (leftHandExpression) { adapter = setProperty; if (isGroovyObject(objectExpression)) adapter = setGroovyObjectProperty; if (isStaticContext() && isThisOrSuper(objectExpression)) adapter = setProperty; } else { adapter = getProperty; if (isGroovyObject(objectExpression)) adapter = getGroovyObjectProperty; if (isStaticContext() && isThisOrSuper(objectExpression)) adapter = getProperty; } visitAttributeOrProperty(expression, adapter); }
public void visitPropertyExpression(PropertyExpression expression) { Expression objectExpression = expression.getObjectExpression(); MethodCallerMultiAdapter adapter; if (leftHandExpression) { adapter = setProperty; if (isGroovyObject(objectExpression)) adapter = setGroovyObjectProperty; if (isStaticContext() && isThisOrSuper(objectExpression)) adapter = setProperty; } else { adapter = getProperty; if (isGroovyObject(objectExpression)) adapter = getGroovyObjectProperty; if (isStaticContext() && isThisOrSuper(objectExpression)) adapter = getProperty; } visitAttributeOrProperty(expression, adapter); }
public void visitPropertyExpression(PropertyExpression expression) { Expression objectExpression = expression.getObjectExpression(); MethodCallerMultiAdapter adapter; if (leftHandExpression) { adapter = setProperty; if (isGroovyObject(objectExpression)) adapter = setGroovyObjectProperty; if (isStaticContext() && isThisOrSuper(objectExpression)) adapter = setProperty; } else { adapter = getProperty; if (isGroovyObject(objectExpression)) adapter = getGroovyObjectProperty; if (isStaticContext() && isThisOrSuper(objectExpression)) adapter = getProperty; } visitAttributeOrProperty(expression, adapter); }
private boolean isStaticInvocation(MethodCallExpression call) { if (!isThisExpression(call.getObjectExpression())) return false; if (isStaticMethod()) return true; return isStaticContext() && !call.isImplicitThis(); }
private boolean isStaticInvocation(MethodCallExpression call) { if (!isThisExpression(call.getObjectExpression())) return false; if (isStaticMethod()) return true; return isStaticContext() && !call.isImplicitThis(); }
private boolean isStaticInvocation(MethodCallExpression call) { if (!isThisExpression(call.getObjectExpression())) return false; if (isStaticMethod()) return true; return isStaticContext() && !call.isImplicitThis(); }
if (isStaticMethod() || (!implicitThis && isStaticContext())) { visitClassExpression(new ClassExpression(classNode)); } else {
if (isStaticMethod() || (!implicitThis && isStaticContext())) { visitClassExpression(new ClassExpression(classNode)); } else {
if (isStaticMethod() || (!implicitThis && isStaticContext())) { visitClassExpression(new ClassExpression(classNode)); } else {
private void makeInvokeMethodCall(MethodCallExpression call, boolean useSuper, MethodCallerMultiAdapter adapter) { // receiver // we operate on GroovyObject if possible Expression objectExpression = call.getObjectExpression(); if (!isStaticMethod() && !isStaticContext() && isThisExpression(call.getObjectExpression())) { objectExpression = new CastExpression(classNode, objectExpression); } // message name Expression messageName = new CastExpression(ClassHelper.STRING_TYPE, call.getMethod()); if (useSuper) { makeCall(new ClassExpression(getOutermostClass().getSuperClass()), objectExpression, messageName, call.getArguments(), adapter, call.isSafe(), call.isSpreadSafe(), false ); } else { makeCall(objectExpression, messageName, call.getArguments(), adapter, call.isSafe(), call.isSpreadSafe(), call.isImplicitThis() ); } }
private void makeInvokeMethodCall(MethodCallExpression call, boolean useSuper, MethodCallerMultiAdapter adapter) { // receiver // we operate on GroovyObject if possible Expression objectExpression = call.getObjectExpression(); if (!isStaticMethod() && !isStaticContext() && isThisExpression(call.getObjectExpression())) { objectExpression = new CastExpression(classNode, objectExpression); } // message name Expression messageName = new CastExpression(ClassHelper.STRING_TYPE, call.getMethod()); if (useSuper) { makeCall(new ClassExpression(getOutermostClass().getSuperClass()), objectExpression, messageName, call.getArguments(), adapter, call.isSafe(), call.isSpreadSafe(), false ); } else { makeCall(objectExpression, messageName, call.getArguments(), adapter, call.isSafe(), call.isSpreadSafe(), call.isImplicitThis() ); } }
private void makeInvokeMethodCall(MethodCallExpression call, boolean useSuper, MethodCallerMultiAdapter adapter) { // receiver // we operate on GroovyObject if possible Expression objectExpression = call.getObjectExpression(); if (!isStaticMethod() && !isStaticContext() && isThisExpression(call.getObjectExpression())) { objectExpression = new CastExpression(ClassHelper.make(GroovyObject.class), objectExpression); } // message name Expression messageName = new CastExpression(ClassHelper.STRING_TYPE, call.getMethod()); if (useSuper) { makeCall(new ClassExpression(getOutermostClass().getSuperClass()), objectExpression, messageName, call.getArguments(), adapter, call.isSafe(), call.isSpreadSafe(), false ); } else { makeCall(objectExpression, messageName, call.getArguments(), adapter, call.isSafe(), call.isSpreadSafe(), call.isImplicitThis() ); } }