/** Generate the given object. * * @param closure the closure. * @param it the target for the generated content. * @param context the context. * @return the closure. */ @SuppressWarnings("static-method") protected XExpression _generate(XClosure closure, IAppendable it, IExtraLanguageGeneratorContext context) { if (it.hasName(closure)) { appendReturnIfExpectedReturnedExpression(it, context); it.append(it.getName(closure)).append("()"); //$NON-NLS-1$ } return closure; }
if (!it.hasName(anonClass) && it instanceof PyAppendable) { final LightweightTypeReference jvmAnonType = getExpectedType(anonClass); final String anonName = it.declareSyntheticVariable(anonClass, jvmAnonType.getSimpleName());
/** Generate the given object. * * @param anonClass the anonymous class. * @param it the target for the generated content. * @param context the context. * @return the class definition. */ protected XExpression _generate(AnonymousClass anonClass, IAppendable it, IExtraLanguageGeneratorContext context) { if (it.hasName(anonClass)) { appendReturnIfExpectedReturnedExpression(it, context); it.append(it.getName(anonClass)).append("("); //$NON-NLS-1$ boolean firstArg = true; for (final XExpression arg : anonClass.getConstructorCall().getArguments()) { if (firstArg) { firstArg = false; } else { it.append(", "); //$NON-NLS-1$ } generate(arg, it, context); } it.append(")"); //$NON-NLS-1$ } return anonClass; }
if (!it.hasName(closure)) { final LightweightTypeReference closureType0 = getExpectedType(closure); LightweightTypeReference closureType = closureType0;