@Override public boolean isAnonymous() { return type.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE && ((JvmGenericType) type).isAnonymous(); }
@Override protected boolean internalCanCompileToJavaExpression(XExpression expression, ITreeAppendable appendable) { if(expression instanceof AnonymousClass) { AnonymousClass anonymousClass = (AnonymousClass) expression; JvmGenericType inferredLocalClass = associations.getInferredType(anonymousClass); return inferredLocalClass.isAnonymous(); } else return super.internalCanCompileToJavaExpression(expression, appendable); }
protected Iterable<JvmMember> _getMembersToBeCompiled(final JvmGenericType it) { Iterable<JvmMember> _xifexpression = null; boolean _isAnonymous = it.isAnonymous(); if (_isAnonymous) { final Function1<JvmMember, Boolean> _function = (JvmMember it_1) -> { return Boolean.valueOf((!(it_1 instanceof JvmConstructor))); }; _xifexpression = IterableExtensions.<JvmMember>filter(it.getMembers(), _function); } else { _xifexpression = this._getMembersToBeCompiled(((JvmDeclaredType) it)); } return _xifexpression; }
protected void _visit(final JvmGenericType jvmType, final INode originNode, final ImportsAcceptor acceptor) { boolean _isAnonymous = jvmType.isAnonymous(); if (_isAnonymous) { this.visit(IterableExtensions.<JvmTypeReference>last(jvmType.getSuperTypes()).getType(), originNode, acceptor); } else { this._visit(((JvmDeclaredType) jvmType), originNode, acceptor); } }
protected void appendConstructedTypeName(XConstructorCall constructorCall, ITreeAppendable typeAppendable) { JvmDeclaredType type = constructorCall.getConstructor().getDeclaringType(); if (type instanceof JvmGenericType && ((JvmGenericType) type).isAnonymous()) { typeAppendable.append(Iterables.getLast(type.getSuperTypes()).getType()); } else { typeAppendable.append(constructorCall.getConstructor().getDeclaringType()); } }
@Override public ITreeAppendable generateVisibilityModifier(final JvmMember it, final ITreeAppendable result) { ITreeAppendable _xblockexpression = null; { JvmVisibility _visibility = it.getVisibility(); boolean _equals = Objects.equal(_visibility, JvmVisibility.PRIVATE); if (_equals) { JvmDeclaredType _declaringType = it.getDeclaringType(); boolean _tripleEquals = (_declaringType == null); if (_tripleEquals) { return result; } if ((it.getDeclaringType().isLocal() && (it instanceof JvmOperation))) { JvmDeclaredType _declaringType_1 = it.getDeclaringType(); final JvmGenericType declarator = ((JvmGenericType) _declaringType_1); boolean _isAnonymous = declarator.isAnonymous(); boolean _not = (!_isAnonymous); if (_not) { return result; } } } _xblockexpression = super.generateVisibilityModifier(it, result); } return _xblockexpression; }
if (hasTypeArguments || (expr.isAnonymousClassConstructorCall() && !explicitTypeArguments.isEmpty() && ((JvmGenericType) constructor.getDeclaringType()).isAnonymous())) { if (typeArguments.isEmpty()) { LightweightTypeReference createdType = resolvedTypes.getActualType(expr);
@Override protected boolean isVariableDeclarationRequired(XExpression expr, ITreeAppendable b, boolean recursive) { boolean result = super.isVariableDeclarationRequired(expr, b, recursive); if (result && expr instanceof XConstructorCall) { EObject container = expr.eContainer(); if (container instanceof AnonymousClass) { AnonymousClass anonymousClass = (AnonymousClass) container; result = isVariableDeclarationRequired(anonymousClass, b, recursive); if (result) { JvmConstructor constructor = anonymousClass.getConstructorCall().getConstructor(); JvmDeclaredType type = constructor.getDeclaringType(); if (((JvmGenericType) type).isAnonymous()) { return false; } } } } return result; }
protected ITreeAppendable _generateBody(final JvmGenericType it, final ITreeAppendable appendable, final GeneratorConfig config) { ITreeAppendable _xblockexpression = null; { this.generateJavaDoc(it, appendable, config); final ITreeAppendable childAppendable = appendable.trace(it); this.generateAnnotations(it.getAnnotations(), childAppendable, true, config); this.generateModifier(it, childAppendable, config); boolean _isInterface = it.isInterface(); if (_isInterface) { childAppendable.append("interface "); } else { childAppendable.append("class "); } this._treeAppendableUtil.traceSignificant(childAppendable, it).append(this.makeJavaIdentifier(it.getSimpleName())); this.generateTypeParameterDeclaration(it, childAppendable, config); boolean _isEmpty = it.getTypeParameters().isEmpty(); if (_isEmpty) { childAppendable.append(" "); } this.generateExtendsClause(it, childAppendable, config); this.generateMembersInBody(it, childAppendable, config); ITreeAppendable _xifexpression = null; if (((!it.isAnonymous()) && (!(it.eContainer() instanceof JvmType)))) { _xifexpression = appendable.newLine(); } _xblockexpression = _xifexpression; } return _xblockexpression; }
public void compileLocalTypeStubs(final JvmFeature feature, final ITreeAppendable appendable, final GeneratorConfig config) { final Function1<JvmGenericType, Boolean> _function = (JvmGenericType it) -> { boolean _isAnonymous = it.isAnonymous(); return Boolean.valueOf((!_isAnonymous)); };